Jump to content
  • Advertisement
Sign in to follow this  
agentprog

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

This topic is 1498 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!