Advertisement

[Patch] asIScriptFunction::GetDeclaration() doesn't preserve commas for list constuctor/factory

Started by May 16, 2014 07:12 AM
1 comment, last by WitchLord 10 years, 6 months 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.

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

Advertisement

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