# HG changeset patch # User nemo # Date 1361814890 18000 # Node ID 286ebfcb3d97a5257637124d1948c47a6ed36b10 # Parent 684169401a2ff636d99906f993b91b295d6324eb workaround for frequent AllHH active call in hedgehog step diff -r 684169401a2f -r 286ebfcb3d97 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Mon Feb 25 12:29:39 2013 -0500 +++ b/hedgewars/uGears.pas Mon Feb 25 12:54:50 2013 -0500 @@ -46,7 +46,8 @@ procedure ProcessGears; procedure EndTurnCleanup; procedure SetAllToActive; -procedure SetAllHHToActive; +procedure SetAllHHToActive; inline; +procedure SetAllHHToActive(Ice: boolean); procedure DrawGears; procedure FreeGearsList; procedure AddMiscGears; @@ -561,7 +562,12 @@ end end; -procedure SetAllHHToActive; +procedure SetAllHHToActive; inline; +begin +SetAllHHToActive(true) +end; + +procedure SetAllHHToActive(Ice: boolean); var t: PGear; begin AllInactive:= false; @@ -570,14 +576,13 @@ begin if (t^.Kind = gtHedgehog) or (t^.Kind = gtExplosives) then begin - if t^.Kind = gtHedgehog then CheckIce(t); + if (t^.Kind = gtHedgehog) and Ice then CheckIce(t); t^.Active:= true end; t:= t^.NextGear end end; - procedure DrawGears; var Gear: PGear; x, y: LongInt; diff -r 684169401a2f -r 286ebfcb3d97 hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Mon Feb 25 12:29:39 2013 -0500 +++ b/hedgewars/uGearsHedgehog.pas Mon Feb 25 12:54:50 2013 -0500 @@ -779,7 +779,7 @@ if (not cArtillery) and ((Gear^.Message and gmPrecise) = 0) then MakeHedgehogsStep(Gear); - SetAllHHToActive; + SetAllHHToActive(false); AddGearCI(Gear) end end; @@ -1257,7 +1257,7 @@ DeleteGear(Gear); exit end; -if (GameTicks mod (100*LongWord(hwRound(cMaxWindSpeed*2/cGravity))) = 0) then CheckIce(Gear); +if GameTicks mod 100 = 0 then CheckIce(Gear); if Gear^.Hedgehog^.Effects[heFrozen] > 0 then begin if Gear^.Hedgehog^.Effects[heFrozen] > 256 then