It looks like fix for cluster bomb issue...
authorunc0rr
Thu, 08 May 2008 21:27:59 +0000
changeset 919 fadfefc2ae40
parent 918 c8cff180da57
child 920 4144204da077
It looks like fix for cluster bomb issue...
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Thu May 08 20:54:04 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Thu May 08 21:27:59 2008 +0000
@@ -111,6 +111,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepBomb(Gear: PGear);
 var i: LongInt;
+    dX, dY: hwFloat;
 begin
 AllInactive:= false;
 doStepFallingGear(Gear);
@@ -122,7 +123,11 @@
       gtClusterBomb: begin
                      doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound);
                      for i:= 0 to 4 do
-                         AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, rndSign(GetRandom * _0_1), (GetRandom - _3) * _0_08, 0);
+                         begin
+                         dX:= rndSign(GetRandom * _0_1);
+                         dY:= (GetRandom - _3) * _0_08;
+                         AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 0);
+                         end
                      end
         end;
    DeleteGear(Gear);