Handling for Library being passed to AngelscriptResolver being nullptr, for testing purposes.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-09-19 13:33:17 +02:00
parent 1568c561d0
commit 9e507d5c3f
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 7 additions and 2 deletions

View File

@ -84,8 +84,13 @@ void AngelScriptResolver::Initialize(CreatureLib::Battling::BattleLibrary* arg)
RegisterTypes(); RegisterTypes();
RegisterExceptionRoutines(_engine); RegisterExceptionRoutines(_engine);
if (library != nullptr){
auto& staticLib = library->GetStaticLib(); auto& staticLib = library->GetStaticLib();
_engine->RegisterGlobalProperty("const StaticLibrary@ StaticLib", (void*)staticLib.get()); _engine->RegisterGlobalProperty("const StaticLibrary@ StaticLib", (void*)staticLib.get());
}
else{
_engine->RegisterGlobalProperty("const StaticLibrary@ StaticLib", nullptr);
}
_contextPool = new ContextPool(_engine); _contextPool = new ContextPool(_engine);
} }