Advertisement

Problem with SetDefaultNamespace in asIScriptModule

Started by May 26, 2024 09:00 PM
1 comment, last by WitchLord 5 months, 4 weeks ago

Hello. There seems to be issues with the asScriptModule::SetDefaultNamespace method. The problem is that this method does not register the base namespace. For example:

module→SetDefaultNamespace("Namespace1::Namespace2")

In this example, the namespace "Namespace1::Namespace2" will be registered, but the namespace "Namespace1" will not be registered if it does not currently exist. Maybe need to add the following piece of code to asCScriptModule::SetDefaultNamespace?

// Make sure parent namespaces are registred in case of nested namespaces
if (expectIdentifier)
 	m_engine->AddNameSpace(ns.SubString(0, pos + len).AddressOf());

Thanks for letting me know. I'll look into this

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