🎉 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!

Script builder addon fails on variable declaration

Started by
1 comment, last by WitchLord 1 week, 4 days ago

Just ran into a fun failed assertion with metadata extraction in the scriptbuilder addon:

class Bar {}
class Foo { Foo(const Bar &in b) {} }

[Metadata]
Foo Test(Bar());

This fails because the declaration is wrongly extracted in CScriptBuilder::ExtractDeclaration. The name field actually becomes Bar here, and the declaration contains the entire line of code.

As a workaround, this seems to work, but requires a default constructor:

class Bar {}
class Foo {
	Foo() {}
	Foo(const Bar &in b) {}
}

[Metadata]
Foo Test = Foo(Bar());

Advertisement

Thanks. I'll have this fixed.

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