Advertisement

Script builder addon fails on variable declaration

Started by June 09, 2024 07:42 PM
2 comments, last by WitchLord 1 week, 6 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());

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

Fixed in revision 2946

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