Constrain to <= to avoid a bug on bottom edge reported by Henek
authornemo
Mon, 11 Oct 2010 12:37:42 -0400
changeset 3961 cf0ca1ff6c1a
parent 3960 ada50f8d4186
child 3962 e9ee2bd51e08
Constrain to <= to avoid a bug on bottom edge reported by Henek
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Mon Oct 11 12:13:06 2010 -0400
+++ b/hedgewars/uWorld.pas	Mon Oct 11 12:37:42 2010 -0400
@@ -247,7 +247,7 @@
 for i:= 0 to cMaxSlotIndex do
     if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
         begin
-        if (cScreenHeight - CursorPoint.Y >= y) and (cScreenHeight - CursorPoint.Y < y + AMSlotSize) then Slot:= i;
+        if (cScreenHeight - CursorPoint.Y >= y) and (cScreenHeight - CursorPoint.Y <= y + AMSlotSize) then Slot:= i;
         inc(SlotsNum);
         DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0);
         t:= 0;
@@ -303,7 +303,7 @@
 for i:= cMaxSlotIndex downto 0 do
     if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
         begin
-        if (cScreenHeight - CursorPoint.Y >= y - AMSlotSize) and (cScreenHeight - CursorPoint.Y < y) then Slot:= i;
+        if (cScreenHeight - CursorPoint.Y >= y - AMSlotSize) and (cScreenHeight - CursorPoint.Y <= y) then Slot:= i;
         dec(y, AMSlotSize);
         inc(SlotsNum);
         DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0);