stick: Fix a logic error I introduced

Late night hacking causes all kinds of silliness. We only want to stop running
an action when the key is not pressed now, but was prior pressed. My logic
caused it to fire when not pressed and not prior pressed, erroneously, leading
to stuck keys.
This commit is contained in:
June Tate-Gans 2021-04-25 23:16:03 -05:00
parent 4d964dd0c0
commit e97cb2c6c3

View File

@ -97,8 +97,10 @@ void StickZone::test(const ZoneCoord &loc) {
bool prior_active = _active; bool prior_active = _active;
_active = _bounds.contains(loc); _active = _bounds.contains(loc);
if ((!_active) && prior_active) { if (!_active) {
if (prior_active) {
_action->act(false); _action->act(false);
}
} else { } else {
_action->act(true); _action->act(true);
} }