mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-15 14:47:13 +02:00
Add the possibility to have null entity instances intentionally.
This commit is contained in:
@ -29,6 +29,19 @@ SQInteger CCheckpoint::Typename(HSQUIRRELVM vm)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CCheckpoint::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullCheckpoint().GetObject());
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CCheckpoint::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullCheckpoint();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CCheckpoint::CCheckpoint(Int32 id)
|
||||
: m_ID(VALID_ENTITYGETEX(id, SQMOD_CHECKPOINT_POOL))
|
||||
@ -546,6 +559,8 @@ void Register_CCheckpoint(HSQUIRRELVM vm)
|
||||
(_SC("Create"), &Checkpoint_Create)
|
||||
.StaticOverload< Object & (*)(Int32, bool, const Vector3 &, const Color4 &, Float32, Int32, Object &) >
|
||||
(_SC("Create"), &Checkpoint_Create)
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CCheckpoint::SqGetNull)
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user