--- 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:
--- 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