Skip to main content
GameDev.net gamedev.net
🔒 Locked

Inconsistent result of asIScriptModule GetTypeInfoByDecl and GetTypeIdByDecl

Started by HenryAWE Mar 6, 2025 at 12:30 PM 1 replies 1.9k views
Original Post
HenryAWE
HenryAWE

This passed the assertion

int foo_handle_id = m->GetTypeIdByDecl("foo@");
assert(is_objhandle(foo_handle_id));

But this didn't

int foo_handle_id = m->GetTypeInfoByDecl("foo@")->GetTypeId();
assert(is_objhandle(foo_handle_id));

The is_objhandle(int type_id) tests the asTYPEID_OBJHANDLE bit.

None
WitchLord
WitchLord

TypeInfo represents the actual type, not the handle. GetTypeInfo("foo") and GetTypeInfo("foo@") will both give the typeinfo for the foo type.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.