mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-19 16:47:14 +02:00
Add the possibility to have null entity instances intentionally.
This commit is contained in:
@ -25,6 +25,19 @@ SQInteger CVehicle::Typename(HSQUIRRELVM vm)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CVehicle::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullVehicle().GetObject());
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CVehicle::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullVehicle();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CVehicle::CVehicle(Int32 id)
|
||||
: m_ID(VALID_ENTITYGETEX(id, SQMOD_VEHICLE_POOL))
|
||||
@ -1811,7 +1824,8 @@ void Register_CVehicle(HSQUIRRELVM vm)
|
||||
(_SC("Create"), &Vehicle_Create)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, const Vector3 &, Float32, Int32, Int32, Int32, Object &) >
|
||||
(_SC("Create"), &Vehicle_Create)
|
||||
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CVehicle::SqGetNull)
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user