Skip to content

Commit

Permalink
Merge pull request #370 from mstevetodd/master
Browse files Browse the repository at this point in the history
avoid out of bounds error reported to Play Store
  • Loading branch information
mstevetodd authored Oct 30, 2018
2 parents 08a31e9 + 3a1aab3 commit 901f938
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EngineDriver/src/main/java/jmri/enginedriver/throttle.java
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,7 @@ public boolean dispatchGenericMotionEvent(android.view.MotionEvent event) {
int repeatCnt = 0;
int whichGamePadIsEventFrom = findWhichGamePadEventIsFrom(event.getDeviceId(), 0); // dummy eventKeyCode

if (whichGamePadIsEventFrom > -1) { // the event came for a gamepad
if ((whichGamePadIsEventFrom > -1) && (whichGamePadIsEventFrom < gamePadDeviceIdsTested.length)) { // the event came from a gamepad
if (gamePadDeviceIdsTested[getGamePadIndexFromThrottleNo(whichGamePadIsEventFrom)]!=GAMEPAD_GOOD) { //if not, testing for this gamepad is not complete or has failed
acceptEvent = false;
}
Expand Down Expand Up @@ -2610,7 +2610,7 @@ public boolean dispatchKeyEvent(KeyEvent event) {
int whichThrottle;
int whichGamePadIsEventFrom = findWhichGamePadEventIsFrom(event.getDeviceId(), event.getKeyCode());

if (whichGamePadIsEventFrom > -1) { // the event came for a gamepad
if ((whichGamePadIsEventFrom > -1) && (whichGamePadIsEventFrom < gamePadDeviceIdsTested.length)) { // the event came from a gamepad
if (gamePadDeviceIdsTested[getGamePadIndexFromThrottleNo(whichGamePadIsEventFrom)]!=GAMEPAD_GOOD) { //if not, testing for this gamepad is not complete or has failed
acceptEvent = false;
}
Expand Down

0 comments on commit 901f938

Please sign in to comment.