Fix default config and the latest bug with input hiearchy

This commit is contained in:
kalaposfos13 2024-11-15 16:57:49 +01:00
parent f5f988d63e
commit 3d4db91225
2 changed files with 13 additions and 8 deletions

View File

@ -756,9 +756,9 @@ touchpad = g;
#Transform
l1 = rightbutton, lshift;
#Shoot
r1 = leftbutton;
#Light attack
r1 = leftbutton;
#Shoot
l2 = rightbutton;
#Heavy attack
r2 = leftbutton, lshift;

View File

@ -461,11 +461,10 @@ bool IsInputActive(const InputBinding& i) {
// Search for the current key in pressed_keys starting from the last checked position
while (pressed_it != pressed_end && pressed_it->first <= key) {
if (pressed_it->first == key) {
if (!pressed_it->second) {
key_found = true;
flags_to_set.push_back(
&pressed_it->second); // Collect pointer if flag is not already set
}
key_found = true;
flags_to_set.push_back(&pressed_it->second);
++pressed_it; // Move to the next key in pressed_keys
break;
}
@ -479,7 +478,13 @@ bool IsInputActive(const InputBinding& i) {
}
}
// Set all flags now that we've verified all keys are active
bool is_fully_blocked = true;
for (bool* flag : flags_to_set) {
is_fully_blocked &= *flag;
}
if(is_fully_blocked) {
return false;
}
for (bool* flag : flags_to_set) {
*flag = true;
}