1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-22 01:57:14 +02:00

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
2020-03-21 13:54:38 +02:00
parent e1ce21962e
commit 863948eb2e
3 changed files with 28 additions and 9 deletions

@ -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);