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

Problem with SetDefaultNamespace in asIScriptModule

Started by
1 comment, last by WitchLord 2 weeks, 2 days 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());

Advertisement

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

Advertisement