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:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user