--- a/hedgewars/uWorld.pas Sat Mar 17 17:24:38 2012 -0400
+++ b/hedgewars/uWorld.pas Tue Mar 13 21:09:46 2012 +0100
@@ -503,17 +503,23 @@
AMShiftTargetY:= cScreenHeight - AmmoRect.y;
AMShiftX:= AMShiftTargetX;
AMShiftY:= AMShiftTargetY;
-
- if (AMShiftTargetX div MENUSPEED) < (AMShiftTargetY div MENUSPEED) then
+
+ if (AMShiftTargetX = 0) or (AMShiftTargetY = 0) then
begin
MenuSpeedX:= MENUSPEED;
- MenuSpeedY:= AMShiftTargetY div (AMShiftTargetX div MENUSPEED);
+ MENUSpeedY:= MENUSPEED;
end
else
- begin
- MenuSpeedX:= AMShiftTargetX div (AMShiftTargetY div MENUSPEED);
- MenuSpeedY:= MENUSPEED;
- end;
+ if (AMShiftTargetX div MENUSPEED) < (AMShiftTargetY div MENUSPEED) then
+ begin
+ MenuSpeedX:= MENUSPEED;
+ MenuSpeedY:= AMShiftTargetY div (AMShiftTargetX div MENUSPEED);
+ end
+ else
+ begin
+ MenuSpeedX:= AMShiftTargetX div (AMShiftTargetY div MENUSPEED);
+ MenuSpeedY:= MENUSPEED;
+ end;
end;
if bShowAmmoMenu then // show ammo menu