# HG changeset patch # User Wuzzy # Date 1554686134 -7200 # Node ID ba8dd081359d4d7ecb93bfb9c1a1290ac2c895d8 # Parent b3fa6a19fc25c2175218c45f815ec675d8015fb5 Fix map preview not matching actual map diff -r b3fa6a19fc25 -r ba8dd081359d hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Mon Apr 08 02:22:51 2019 +0200 +++ b/hedgewars/hwengine.pas Mon Apr 08 03:15:34 2019 +0200 @@ -106,6 +106,7 @@ PlayMusic; InitZoom(zoom); ScriptCall('onGameStart'); + RandomizeHHAnim; for t:= 0 to Pred(TeamsCount) do with TeamsArray[t]^ do MaxTeamHealth:= TeamHealth; diff -r b3fa6a19fc25 -r ba8dd081359d hedgewars/uGears.pas --- a/hedgewars/uGears.pas Mon Apr 08 02:22:51 2019 +0200 +++ b/hedgewars/uGears.pas Mon Apr 08 03:15:34 2019 +0200 @@ -46,6 +46,7 @@ procedure FreeGearsList; procedure AddMiscGears; procedure AssignHHCoords; +procedure RandomizeHHAnim; procedure StartSuddenDeath; function GearByUID(uid : Longword) : PGear; function IsClockRunning() : boolean; @@ -1064,6 +1065,18 @@ SortHHsByClan(); end; +// Set random pos for all hogs so their animations have different starting points +procedure RandomizeHHAnim; +var i, j, p: LongInt; +begin + for p:= 0 to (ClansCount - 1) do + with SpawnClansArray[p]^ do + for j:= 0 to Pred(TeamsNumber) do + with Teams[j]^ do + for i:= 0 to cMaxHHIndex do + if (Hedgehogs[i].Gear <> nil) then + Hedgehogs[i].Gear^.Pos:= GetRandom(19); +end; {procedure AmmoFlameWork(Ammo: PGear); var t: PGear; diff -r b3fa6a19fc25 -r ba8dd081359d hedgewars/uGearsList.pas --- a/hedgewars/uGearsList.pas Mon Apr 08 02:22:51 2019 +0200 +++ b/hedgewars/uGearsList.pas Mon Apr 08 03:15:34 2019 +0200 @@ -312,7 +312,6 @@ gear^.Angle:= cMaxAngle div 2; gear^.Density:= _3; gear^.Z:= cHHZ; - gear^.Pos:= GetRandom(19); if (GameFlags and gfAISurvival) <> 0 then if gear^.Hedgehog^.BotLevel > 0 then gear^.Hedgehog^.Effects[heResurrectable] := 1;