# HG changeset patch # User nemo # Date 1451483419 18000 # Node ID 26068971a4de5c9479a63341c8b1c5089fdbe075 # Parent 2f6f8baa2a97fe1b1f8026e2fa99db2393267f36 call this faller scrambling less often. diff -r 2f6f8baa2a97 -r 26068971a4de hedgewars/uGears.pas --- a/hedgewars/uGears.pas Tue Dec 29 14:44:32 2015 -0500 +++ b/hedgewars/uGears.pas Wed Dec 30 08:50:19 2015 -0500 @@ -168,7 +168,9 @@ i, AliveCount: LongInt; s: ansistring; prevtime: LongWord; + stirFallers: boolean; begin +stirFallers:= false; prevtime:= TurnTimeLeft; ScriptCall('onGameTick'); if GameTicks mod 20 = 0 then ScriptCall('onGameTick20'); @@ -199,6 +201,8 @@ begin curHandledGear:= t; t:= curHandledGear^.NextGear; + if (GameTicks and $1FFF = 0) and (curHandledGear^.Kind = gtCase) and (curHandledGear^.Pos <> posCaseHealth) then + stirFallers := true; if curHandledGear^.Message and gmDelete <> 0 then DeleteGear(curHandledGear) @@ -224,6 +228,23 @@ end end end; +if stirFallers then + begin + t := GearsList; + while t <> nil do + begin + if t^.Kind = gtGenericFaller then + begin + t^.Active:= true; + t^.X:= int2hwFloat(GetRandom(rightX-leftX)+leftX); + t^.Y:= int2hwFloat(GetRandom(LAND_HEIGHT-topY)+topY); + t^.dX:= _90-(GetRandomf*_360); + t^.dY:= _90-(GetRandomf*_360) + end; + t := t^.NextGear + end + end; + curHandledGear:= nil; if AllInactive then diff -r 2f6f8baa2a97 -r 26068971a4de hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Tue Dec 29 14:44:32 2015 -0500 +++ b/hedgewars/uGearsHandlersMess.pas Wed Dec 30 08:50:19 2015 -0500 @@ -2169,23 +2169,6 @@ end else begin - if (Gear^.Pos <> posCaseHealth) and (GameTicks and $1FFF = 0) then // stir 'em up periodically - begin - gi := GearsList; - while gi <> nil do - begin - if gi^.Kind = gtGenericFaller then - begin - gi^.Active:= true; - gi^.X:= int2hwFloat(GetRandom(rightX-leftX)+leftX); - gi^.Y:= int2hwFloat(GetRandom(LAND_HEIGHT-topY)+topY); - gi^.dX:= _90-(GetRandomf*_360); - gi^.dY:= _90-(GetRandomf*_360) - end; - gi := gi^.NextGear - end - end; - if Gear^.Timer = 500 then begin (* Can't make sparkles team coloured without working out what the next team is going to be. This should be solved, really, since it also screws up