mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-07-09 01:57:09 +02:00
Add the possibility to have null entity instances intentionally.
This commit is contained in:
@@ -23,6 +23,19 @@ SQInteger CObject::Typename(HSQUIRRELVM vm)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CObject::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullObject().GetObject());
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CObject::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullObject();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CObject::CObject(Int32 id)
|
||||
: m_ID(VALID_ENTITYGETEX(id, SQMOD_OBJECT_POOL))
|
||||
@@ -927,6 +940,8 @@ void Register_CObject(HSQUIRRELVM vm)
|
||||
(_SC("Create"), &Object_Create)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, const Vector3 &, Int32, Int32, Object &) >
|
||||
(_SC("Create"), &Object_Create)
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CObject::SqGetNull)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user