Fix first ammo row being invisible when there's only one weapon in the first row
authorWuzzy <almikes@aol.com>
Fri, 20 Oct 2017 21:35:26 +0200
changeset 12724 637b1987570e
parent 12723 185c7f378f9d
child 12725 7b5618923920
Fix first ammo row being invisible when there's only one weapon in the first row
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Fri Oct 20 21:02:43 2017 +0200
+++ b/hedgewars/uWorld.pas	Fri Oct 20 21:35:26 2017 +0200
@@ -424,7 +424,7 @@
 
     SlotsNum:= 0;
     for i:= 0 to cMaxSlotIndex do
-        if((i = 0) and (Ammo^[i,1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i,0].Count > 0)) then
+        if (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0) then
             inc(SlotsNum);
 {$IFDEF USE_LANDSCAPE_AMMOMENU}
     SlotsNumX:= SlotsNum;
@@ -455,7 +455,7 @@
     x:= AMRect.x;
     y:= AMRect.y;
     for i:= 0 to cMaxSlotIndex do
-        if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0)) then
+        if (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0) then
             begin
 {$IFDEF USE_LANDSCAPE_AMMOMENU}
             y:= AMRect.y;
@@ -662,7 +662,7 @@
 {$IFDEF USE_LANDSCAPE_AMMOMENU}
 c:= -1;
     for i:= 0 to cMaxSlotIndex do
-        if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0)) then
+        if (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0) then
             begin
             inc(c);
     {$IFDEF USE_AM_NUMCOLUMN}
@@ -692,7 +692,7 @@
 {$ELSE}
 c:= -1;
     for i:= 0 to cMaxSlotIndex do
-        if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0)) then
+        if (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0) then
             begin
             inc(c);
     {$IFDEF USE_AM_NUMCOLUMN}