# HG changeset patch # User Wuzzy # Date 1518003011 -3600 # Node ID 0f02dd1ff4c98dd36c6099b6267f9edf4037800c # Parent 6deb29364723d51d862eab846fb205551552ce42 Fix TotalRounds counting rounds a couple of turns too late diff -r 6deb29364723 -r 0f02dd1ff4c9 ChangeLog.txt --- a/ChangeLog.txt Wed Feb 07 11:03:14 2018 +0100 +++ b/ChangeLog.txt Wed Feb 07 12:30:11 2018 +0100 @@ -24,6 +24,7 @@ Lua API: + New call: WriteLnToChat(string): Add a line in the chat * Fix call: SetWeapon(amNothing) now unselects weapon + * Fix global: TotalRounds was stuck at -1 for several turns ====================== 0.9.23 ====================== HIGHLIGHTS: diff -r 6deb29364723 -r 0f02dd1ff4c9 hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Wed Feb 07 11:03:14 2018 +0100 +++ b/hedgewars/uTeams.pas Wed Feb 07 12:30:11 2018 +0100 @@ -191,23 +191,26 @@ c:= CurrentTeam^.Clan^.ClanIndex; repeat with ClansArray[c]^ do - if (CurrTeam = TagTeamIndex) and ((GameFlags and gfTagTeam) <> 0) then + if (GameFlags and gfTagTeam) <> 0 then begin - TagTeamIndex:= Pred(TagTeamIndex) mod TeamsNumber; - CurrTeam:= Pred(CurrTeam) mod TeamsNumber; - inc(c); - NextClan:= true; - end; + if (CurrTeam = TagTeamIndex) then + begin + if (c = 0) and (not PlacingHogs) then + inc(TotalRounds); + TagTeamIndex:= Pred(TagTeamIndex) mod TeamsNumber; + CurrTeam:= Pred(CurrTeam) mod TeamsNumber; + inc(c); + NextClan:= true; + end; + end + else if (c = 0) and (not PlacingHogs) then + inc(TotalRounds); if (GameFlags and gfTagTeam) = 0 then inc(c); if c = ClansCount then - begin - if not PlacingHogs then - inc(TotalRounds); - c:= 0 - end; + c:= 0; with ClansArray[c]^ do begin