Sign in to follow this  

Patch proposal for scriptany add-on issue

Recommended Posts



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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this