# HG changeset patch # User nemo # Date 1342380928 14400 # Node ID 588eabb4b38410ad3a36aa95d74422e134f01d76 # Parent 15c3fb4882dfc8727d4bf6248329b4382f843f98 Apparently order of multiple getrandom in params is undefined. Also remove broken and pointless getrandom call. diff -r 15c3fb4882df -r 588eabb4b384 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sat Jul 14 23:19:09 2012 -0400 +++ b/hedgewars/GSHandlers.inc Sun Jul 15 15:35:28 2012 -0400 @@ -4655,11 +4655,13 @@ // add some fire to the tunnel if getRandom(6) = 0 then - AddGear(x - Gear^.Radius + LongInt(getRandom(2 * Gear^.Radius)), y - - getRandom(Gear^.Radius + 1), gtFlame, gsttmpFlag, _0, _0, 0); + begin + tmp:= GetRandom(2 * Gear^.Radius); + AddGear(x - Gear^.Radius + tmp, y - GetRandom(Gear^.Radius + 1), gtFlame, gsttmpFlag, _0, _0, 0) + end end; - if getRandom(100) = 0 then + if random(100) = 0 then AddVisualGear(x, y, vgtSmokeTrace); end else dec(Gear^.Health, 5); // if underwater get additional damage diff -r 15c3fb4882df -r 588eabb4b384 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sat Jul 14 23:19:09 2012 -0400 +++ b/hedgewars/uGears.pas Sun Jul 15 15:35:28 2012 -0400 @@ -453,7 +453,6 @@ if (not CurrentTeam^.ExtDriven) or CurrentTeam^.hasGone then inc(hiTicks) // we do not recieve a message for this end; - ScriptCall('onGameTick'); if GameTicks mod 20 = 0 then ScriptCall('onGameTick20'); inc(GameTicks) diff -r 15c3fb4882df -r 588eabb4b384 hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Sat Jul 14 23:19:09 2012 -0400 +++ b/hedgewars/uGearsHedgehog.pas Sun Jul 15 15:35:28 2012 -0400 @@ -596,7 +596,8 @@ procedure PickUp(HH, Gear: PGear); var s: shortstring; a: TAmmoType; - i: LongInt; + i, rx, ry: LongInt; + rdx, rdy: hwFloat; vga: PVisualGear; ag: PGear; begin @@ -620,9 +621,15 @@ begin // Add spawning here... AddRandomness(CheckSum xor GameTicks); + for i:= 0 to GetRandom(50)+50 do - AddGear(GetRandom(rightX-leftX)+leftX, GetRandom(LAND_HEIGHT-topY)+topY, gtGenericFaller, - gstInvisible, _90-(GetRandomf*_360), _90-(GetRandomf*_360), GetRandom(500)); + begin + rx:= GetRandom(rightX-leftX)+leftX; + ry:= GetRandom(LAND_HEIGHT-topY)+topY; + rdx:= _90-(GetRandomf*_360); + rdy:= _90-(GetRandomf*_360); + AddGear(rx, ry, gtGenericFaller, gstInvisible, rdx, rdy, GetRandom(500)); + end; ag:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAddAmmo, gstInvisible, _0, _0, GetRandom(200)+100); ag^.Pos:= Gear^.Pos; ag^.Power:= Gear^.Power diff -r 15c3fb4882df -r 588eabb4b384 hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Sat Jul 14 23:19:09 2012 -0400 +++ b/hedgewars/uGearsRender.pas Sun Jul 15 15:35:28 2012 -0400 @@ -287,7 +287,6 @@ dy:= -Cos(Gear^.Angle * pi / cMaxAngle); if cLaserSighting then begin - GetRandom(2); // no, this does not prevent it, just makes things harder lx:= GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle); ly:= GetLaunchY(HH^.CurAmmoType, Gear^.Angle);