Fix keybind handling bug

Keybinds will be executed only when a game is active
dev
peshomir 2025-03-08 09:33:11 +02:00
parent 98116c8633
commit 77839a0e03
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { getUIGap } from "./gameInterface.js";
import { getUIGap, getVar } from "./gameInterface.js";
import { getSettings } from "./settings.js";
export const keybindFunctions = {
@ -9,7 +9,7 @@ export const keybindFunctions = {
export const keybindHandler = key => {
const keybindData = getSettings().attackPercentageKeybinds.find(keybind => keybind.key === key);
if (keybindData === undefined) return false;
executeKeybind(keybindData);
if (getVar("gameState") !== 0) executeKeybind(keybindData);
return true;
};
function executeKeybind(keybind) {