mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:08:00 +02:00
no negatives
This commit is contained in:
parent
3850271b97
commit
d15527dd04
1 changed files with 2 additions and 2 deletions
|
@ -1256,7 +1256,7 @@ float UserInputMapper::getActionState(Action action) const {
|
||||||
Locker locker(_lock);
|
Locker locker(_lock);
|
||||||
|
|
||||||
int index = toInt(action);
|
int index = toInt(action);
|
||||||
if (index < _actionStates.size()) {
|
if (index >= 0 && index < _actionStates.size()) {
|
||||||
return _actionStates[index];
|
return _actionStates[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1268,7 +1268,7 @@ bool UserInputMapper::getActionStateValid(Action action) const {
|
||||||
Locker locker(_lock);
|
Locker locker(_lock);
|
||||||
|
|
||||||
int index = toInt(action);
|
int index = toInt(action);
|
||||||
if (index < _actionStatesValid.size()) {
|
if (index >= 0 && index < _actionStatesValid.size()) {
|
||||||
return _actionStatesValid[index];
|
return _actionStatesValid[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue