🎉 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] asIScriptFunction::GetDeclaration() doesn't preserve commas for list constuctor/factory

Started by
1 comment, last by WitchLord 10 years, 1 month ago

Hello!

I've noticed, that when using WriteConfigToFile() function with objects having asBEHAVE_LIST_CONSTRUCT or asBEHAVE_LIST_FACTORY behaviors, it writes the declaration without commas in the list declaration. For example, dictionary from add-ons registers it with "dictionary @f(int &in) {repeat {string, ?}}", but after WriteConfigToFile() it looks like "dictionary@ _beh_4_(int&in) { repeat { string ? } }" without comma between "string" and "?". It prevents asbuild from registering such behaviors.

After some digging into WriteConfigToFile(), I've found out, that it just uses the return value of asIScriptFunction::GetDeclaration(), with just escaping the quotes. So commas are removed somewhere inside the engine. It's not a problem to put commas manually in the saved configuration file, but if updating it frequently, it becomes irritating.

After some more digging into engine itself, I think, I've found the problem in as_scriptfunction.cpp in asCScriptFunction::GetDeclarationStr(). Patch is in attachment. It works for me, but I'm not sure if it doesn't break anything else.

I'm using AngelScript library version 2.28.2, so as far as I can see, this is the latest version.

Advertisement

Thanks for the patch. I'll have it fixed in the WIP for the next release.

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

I've checked in the patch in revision 1927.

Thanks,

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

This topic is closed to new replies.

Advertisement