diff -r 26e523c8fe88 -r 025473a2c420 hedgewars/uTouch.pas --- a/hedgewars/uTouch.pas Mon Feb 06 22:59:28 2012 -0500 +++ b/hedgewars/uTouch.pas Tue Feb 07 18:56:49 2012 +0100 @@ -103,12 +103,7 @@ case pointerCount of 1: begin - moveCursor:= false; - if bShowAmmoMenu then - begin - moveCursor := true; - exit; - end; + moveCursor:= not bShowAmmoMenu; if isOnCrosshair(finger^) then begin @@ -157,9 +152,6 @@ ParseCommand('ljump', true); exit; end; - - - moveCursor:= true; end; 2: begin @@ -272,14 +264,20 @@ yTouchClick:= finger.y; timeSinceClick:= SDL_GetTicks; -if bShowAmmoMenu then - begin - CursorPoint.X:= finger.x; - CursorPoint.Y:= finger.y; - doPut(CursorPoint.X, CursorPoint.Y, false); - exit +if bShowAmmoMenu then + begin + if isOnRect(AmmoRect.x, AmmoRect.y, AmmoRect.w, AmmoRect.h, finger) then + begin + CursorPoint.X:= finger.x; + CursorPoint.Y:= finger.y; + doPut(CursorPoint.X, CursorPoint.Y, false); + end + else + bShowAmmoMenu:= false; + exit; end; + if isOnCurrentHog(finger) then begin bShowAmmoMenu := true;