mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-02-20 19:57:12 +01:00
Fix the keybind creation by obtaining a keybind slot automatically if one was not specified.
This commit is contained in:
parent
dae66ca39f
commit
5d0a38cbd9
@ -724,6 +724,16 @@ Object & Core::NewCheckpoint(Int32 player, Int32 world, bool sphere, Float32 x,
|
||||
Object & Core::NewKeybind(Int32 slot, bool release, Int32 primary, Int32 secondary, Int32 alternative,
|
||||
Int32 header, Object & payload)
|
||||
{
|
||||
// Should we obtain a new keybind slot automatically?
|
||||
if (slot < 0)
|
||||
{
|
||||
slot = _Func->GetKeyBindUnusedSlot();
|
||||
}
|
||||
// Validate the keybind slot
|
||||
if (slot < 0)
|
||||
{
|
||||
STHROWF("Out of keybind slots");
|
||||
}
|
||||
// Request the server to create this entity
|
||||
const Int32 id = _Func->RegisterKeyBind(slot, release, primary, secondary, alternative);
|
||||
// See if the entity creation failed on the server
|
||||
|
Loading…
x
Reference in New Issue
Block a user