Advertisement

Patch proposal for scriptany add-on issue

Started by October 16, 2015 10:50 AM
2 comments, last by gjl 9 years, 1 month ago

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 );

Thanks. I'll have it corrected.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

I've fixed this in revision 2243.

Regards,

Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Great, thanks!

This topic is closed to new replies.

Advertisement