Skip to content

Commit

Permalink
UPBGE: Fix keyboard sensor second modifier.
Browse files Browse the repository at this point in the history
Previously only the first sensor was taken into account and the
second modifier always ignored.
This was because the check of status[0] and status[1] only which
correspond to the key and first modifier.

The second modifier (status[2]) is now checked as first modifier
and key.

Fix issue: #965.
  • Loading branch information
panzergame authored and youle31 committed May 26, 2019
1 parent 56fcae1 commit 61d044b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ bool SCA_KeyboardSensor::Evaluate()
result = true;
}

if (!status[0] || (m_qual > 0 && !status[0]) || (m_qual2 > 0 && !status[1])) { /* one of the used qualifiers are not pressed */
if (!status[0] || (m_qual > 0 && !status[1]) || (m_qual2 > 0 && !status[2])) { /* one of the used qualifiers are not pressed */
m_val = false; /* since one of the qualifiers is not on, set the state to false */
}
else {
Expand Down

0 comments on commit 61d044b

Please sign in to comment.