🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Patch proposal for scriptany add-on issue

Started by
2 comments, last by gjl 8 years, 8 months 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 );
Advertisement

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

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