Allow the user to controll when the null entity instances are created. Creating them before executing any scripts will lock entity classes and prevent the user from adding custom elements.

This commit is contained in:
Sandu Liviu Catalin committed 2020-03-21 13:54:38 +02:00
1 parent e1ce21962e
commit 863948eb2e
3 files changed
+28 -9

No files matched your search

+8
View File
@@ -50,6 +50,13 @@ static SQInteger SqGetEvents(HSQUIRRELVM vm)
return 1;
}
// ------------------------------------------------------------------------------------------------
static SQInteger SqEnableNullEntities(HSQUIRRELVM vm)
{
Core::Get().EnableNullEntities();
return 0;
}
// ------------------------------------------------------------------------------------------------
static LightObj & SqGetPreLoadEvent()
{
@@ -351,6 +358,7 @@ void Register_Core(HSQUIRRELVM vm)
.Func(_SC("OnPreLoad"), &SqGetPreLoadEvent)
.Func(_SC("OnPostLoad"), &SqGetPostLoadEvent)
.Func(_SC("OnUnload"), &SqGetUnloadEvent)
.SquirrelFunc(_SC("EnableNullEntities"), &SqEnableNullEntities)
.SquirrelFunc(_SC("LoadScript"), &SqLoadScript)
.SquirrelFunc(_SC("On"), &SqGetEvents);