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

Null instances initialized too late.

They must be initialized before executing scripts.
This commit is contained in:
Sandu Liviu Catalin 2019-08-19 22:27:46 +03:00
parent 7c7c1210e6
commit 789fb31273

View File

@ -380,6 +380,15 @@ bool Core::Initialize()
// ------------------------------------------------------------------------------------------------
bool Core::Execute()
{
// Create the null entity instances
m_NullBlip = LightObj(new CBlip(-1));
m_NullCheckpoint = LightObj(new CCheckpoint(-1));
m_NullKeybind = LightObj(new CKeybind(-1));
m_NullObject = LightObj(new CObject(-1));
m_NullPickup = LightObj(new CPickup(-1));
m_NullPlayer = LightObj(new CPlayer(-1));
m_NullVehicle = LightObj(new CVehicle(-1));
// Are there any scripts to execute?
if (m_PendingScripts.empty())
{
@ -423,15 +432,6 @@ bool Core::Execute()
levels, static_cast< SQUnsignedInteger >(m_PendingScripts.size()));
}
// Create the null entity instances
m_NullBlip = LightObj(new CBlip(-1));
m_NullCheckpoint = LightObj(new CCheckpoint(-1));
m_NullKeybind = LightObj(new CKeybind(-1));
m_NullObject = LightObj(new CObject(-1));
m_NullPickup = LightObj(new CPickup(-1));
m_NullPlayer = LightObj(new CPlayer(-1));
m_NullVehicle = LightObj(new CVehicle(-1));
m_LockPreLoadSignal = true;
// Trigger callbacks that must initialize stuff before the loaded event is triggered
(*mOnPreLoad.first)();