Skip to content

Commit

Permalink
front: Fix range check on TouchController.
Browse files Browse the repository at this point in the history
  • Loading branch information
littleguy77 committed Jan 16, 2013
1 parent bf0e588 commit f886f16
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private void processButtonTouch( boolean touched, int xLocation, int yLocation,
{
// Check if this pointer was already mapped to a button
int prevIndex = mPointerMap.get( pid );
if( prevIndex > 0 && prevIndex != index )
if( prevIndex >= 0 && prevIndex != index )
{
// Release the previous button
setTouchState( prevIndex, false );
Expand All @@ -258,6 +258,7 @@ private void processButtonTouch( boolean touched, int xLocation, int yLocation,
setTouchState( index, touched );
}
}

/**
* Sets the state of a button, and handles the D-Pad diagonals.
*
Expand Down

0 comments on commit f886f16

Please sign in to comment.