• Advertisement
Sign in to follow this  

Patch proposal for scriptany add-on issue

This topic is 854 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

 

while playing with the scriptany addon, I have found a bug when using the constructor with primitive types:

any myAny(10);
int myValue;
myAny.retrieve(myValue); // will fail 

It is simply because the constructor is not defined for double or int64 (as opposed to the store function). Adding the following factory definitions in scriptany.cpp will fix this problem:

r = engine->RegisterObjectBehaviour("any", asBEHAVE_FACTORY, "any@ f(int64&in)", asFUNCTION(ScriptAnyFactory2_Generic), asCALL_GENERIC); assert( r >= 0 );
r = engine->RegisterObjectBehaviour("any", asBEHAVE_FACTORY, "any@ f(double&in)", asFUNCTION(ScriptAnyFactory2_Generic), asCALL_GENERIC); assert( r >= 0 );
Edited by gjl

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement