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:
@@ -16,6 +16,19 @@ SQInteger CKeybind::Typename(HSQUIRRELVM vm)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger CKeybind::SqGetNull(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushobject(vm, Core::Get().GetNullKeybind().GetObject());
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CKeybind::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullKeybind();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CKeybind::CKeybind(Int32 id)
|
||||
: m_ID(VALID_ENTITYGETEX(id, SQMOD_KEYBIND_POOL))
|
||||
@@ -233,6 +246,8 @@ void Register_CKeybind(HSQUIRRELVM vm)
|
||||
(_SC("Create"), &Keybind_Create)
|
||||
.StaticOverload< Object & (*)(bool, Int32, Int32, Int32, Int32, Object &) >
|
||||
(_SC("Create"), &Keybind_Create)
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CKeybind::SqGetNull)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user