# HG changeset patch # User nemo # Date 1264318620 0 # Node ID 51cda17b7c3b556995e43c48032836b7be78536e # Parent fbde0d971ba6c2bc5e7b01e1a8bf473e2c8b38ce Rolling random numbers before land is generated is bad, m'kay? InitWorld probably not the best place for it. diff -r fbde0d971ba6 -r 51cda17b7c3b hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Sun Jan 24 07:26:03 2010 +0000 +++ b/hedgewars/uTeams.pas Sun Jan 24 07:37:00 2010 +0000 @@ -309,18 +309,7 @@ procedure InitTeams; var i, t: LongInt; th: LongInt; - cp: PClan; begin -if (GameFlags and gfRandomOrder) <> 0 then // shuffle them up a bit - for i:= 0 to ClansCount * 8 do - begin - t:= GetRandom(Pred(ClansCount))+1; - cp:= ClansArray[0]; - ClansArray[0]:= ClansArray[t]; - ClansArray[t]:= cp; - ClansArray[t]^.ClanIndex:= t; - ClansArray[0]^.ClanIndex:= 0; - end; for t:= 0 to Pred(TeamsCount) do with TeamsArray[t]^ do begin diff -r fbde0d971ba6 -r 51cda17b7c3b hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Sun Jan 24 07:26:03 2010 +0000 +++ b/hedgewars/uWorld.pas Sun Jan 24 07:37:00 2010 +0000 @@ -20,7 +20,7 @@ unit uWorld; interface -uses SDLh, uGears, uConsts, uFloat; +uses SDLh, uGears, uConsts, uFloat, uRandom; const WorldDx: LongInt = -512; WorldDy: LongInt = -256; @@ -66,7 +66,26 @@ fpsTexture: PTexture; procedure InitWorld; +var i, t: LongInt; + cp: PClan; begin +if (GameFlags and gfRandomOrder) <> 0 then // shuffle them up a bit + begin + for i:= 0 to ClansCount * 4 do + begin + t:= GetRandom(ClansCount); + if t <> 0 then + begin + cp:= ClansArray[0]; + ClansArray[0]:= ClansArray[t]; + ClansArray[t]:= cp; + ClansArray[t]^.ClanIndex:= t; + ClansArray[0]^.ClanIndex:= 0; + end; + end; + CurrentTeam:= ClansArray[0]^.Teams[0]; + end; + cWaveWidth:= SpritesData[sprWater].Width; //cWaveHeight:= SpritesData[sprWater].Height; cWaveHeight:= 32;