Fix a crasher
authorunc0rr
Thu, 04 Feb 2016 21:04:08 +0300
changeset 11534 0ead3a2e0309
parent 11533 3189bf281000
child 11535 135094ab3146
Fix a crasher
hedgewars/hwengine.pas
hedgewars/uAmmos.pas
--- a/hedgewars/hwengine.pas	Mon Feb 01 15:10:10 2016 +0300
+++ b/hedgewars/hwengine.pas	Thu Feb 04 21:04:08 2016 +0300
@@ -81,6 +81,7 @@
             AddFlakes;
             SetRandomSeed(cSeed, false);
             StoreLoad(false);
+            if not allOK then exit;
             AssignHHCoords;
             AddMiscGears;
             InitWorld;
--- a/hedgewars/uAmmos.pas	Mon Feb 01 15:10:10 2016 +0300
+++ b/hedgewars/uAmmos.pas	Thu Feb 04 21:04:08 2016 +0300
@@ -90,8 +90,8 @@
                   , true)
     then exit;
 
+if checkFails(StoreCnt < cMaxHHs, 'Ammo stores overflow', true) then exit;
 inc(StoreCnt);
-if checkFails(StoreCnt <= cMaxHHs, 'Ammo stores overflow', true) then exit;
 
 new(StoresList[Pred(StoreCnt)]);