mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-07-06 08:57:11 +02:00
Add the possibility to have null entity instances intentionally.
This commit is contained in:
@ -21,6 +21,19 @@ SQInteger CPickup::Typename(HSQUIRRELVM vm)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CPickup::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullPickup().GetObject());
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPickup::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullPickup();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CPickup::CPickup(Int32 id)
|
||||
: m_ID(VALID_ENTITYGETEX(id, SQMOD_PICKUP_POOL))
|
||||
@ -427,6 +440,8 @@ void Register_CPickup(HSQUIRRELVM vm)
|
||||
(_SC("Create"), &Pickup_Create)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Int32, const Vector3 &, Int32, bool, Int32, Object &) >
|
||||
(_SC("Create"), &Pickup_Create)
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CPickup::SqGetNull)
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user