Don't call getrandom() from parameters to a function. The order of calls is undefined, so desyncs are probable.
authorunc0rr
Sun, 07 Nov 2010 17:01:48 +0300
changeset 4160 043c17a8b3ca
parent 4159 64e677349124
child 4161 1f19dcdabe19
Don't call getrandom() from parameters to a function. The order of calls is undefined, so desyncs are probable.
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Sun Nov 07 16:41:03 2010 +0300
+++ b/hedgewars/GSHandlers.inc	Sun Nov 07 17:01:48 2010 +0300
@@ -422,7 +422,11 @@
                 begin
                 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound);
                 for i:= 0 to 2 do
-                    AddGear(int64(hwRound(Gear^.X)) - 30 + GetRandom(60), int64(hwRound(Gear^.Y)) - 20 + GetRandom(40), gtPoisonCloud, 0, _0, _0, 0);
+                    begin
+                    x:= GetRandom(60);
+                    y:= GetRandom(40);
+                    AddGear(hwRound(Gear^.X) - 30 + x, hwRound(Gear^.Y) - 20 + y, gtPoisonCloud, 0, _0, _0, 0);
+                    end
                 end;
         end;
     DeleteGear(Gear);