Check if player can use keybinds before processing
This commit is contained in:
@@ -25,7 +25,7 @@ function initKeyBindScript() {
|
|||||||
function bindAccountKey(key, keyState) {
|
function bindAccountKey(key, keyState) {
|
||||||
logToConsole(LOG_DEBUG, `[Asshat.KeyBind]: Binded key ${sdl.getKeyName(key)} (${key})`);
|
logToConsole(LOG_DEBUG, `[Asshat.KeyBind]: Binded key ${sdl.getKeyName(key)} (${key})`);
|
||||||
bindKey(toInteger(key), keyState, function(event) {
|
bindKey(toInteger(key), keyState, function(event) {
|
||||||
if(hasKeyBindDelayElapsed()) {
|
if(hasKeyBindDelayElapsed() && canLocalPlayerUseKeyBinds()) {
|
||||||
lastKeyBindUse = sdl.ticks;
|
lastKeyBindUse = sdl.ticks;
|
||||||
tellServerPlayerUsedKeyBind(key);
|
tellServerPlayerUsedKeyBind(key);
|
||||||
}
|
}
|
||||||
@@ -65,4 +65,10 @@ function hasKeyBindHoldElapsed(keyState) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function canLocalPlayerUseKeyBinds() {
|
||||||
|
return (!usingSkinSelector && isSpawned && !itemActionDelayEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user