Fix a couple more uses of uninitialized variables
authorunC0Rr
Tue, 27 Aug 2019 14:37:39 +0200
changeset 15366 381c828865e7
parent 15365 fcdb6e3a9d36
child 15367 d6b4586b271f
Fix a couple more uses of uninitialized variables
hedgewars/uAIAmmoTests.pas
hedgewars/uAIMisc.pas
--- a/hedgewars/uAIAmmoTests.pas	Tue Aug 27 08:41:48 2019 +0200
+++ b/hedgewars/uAIAmmoTests.pas	Tue Aug 27 14:37:39 2019 +0200
@@ -1367,10 +1367,13 @@
     cake.Radius:= 7;
     cake.CollisionMask:= lfNotCurHogCrate;
     cake.Hedgehog:= Me^.Hedgehog;
+    cake.Kind:= gtCake;
 
     // check left direction
     cake.Angle:= 3;
     cake.dX.isNegative:= true;
+    cake.dX.QWordValue:= 0;
+    cake.dY:= _0;
     cake.X:= Me^.X - _3;
     cake.Y:= Me^.Y;
     checkCakeWalk(Me, @cake, ap);
--- a/hedgewars/uAIMisc.pas	Tue Aug 27 08:41:48 2019 +0200
+++ b/hedgewars/uAIMisc.pas	Tue Aug 27 14:37:39 2019 +0200
@@ -57,7 +57,7 @@
 
 TBonuses = record
           activity: boolean;
-          Count : Longword;
+          Count : LongInt;
           ar    : array[0..Pred(MAXBONUS)] of TBonus;
        end;
 
@@ -799,7 +799,7 @@
                         begin
                         dead:= true;
                         Targets.reset:= true;
-                        if gdX < 0.035 then
+                        if abs(gdX) < 0.035 then
                             begin
                             subrate:= RealRateExplosion(Me, round(pX), round(pY), 61, afErasesLand or afTrackFall);
                             if abs(subrate) > 2000 then inc(Rate,subrate div 1024)