Ticket #44879

end_turn() debug statistics cumulative, not per player

Open Date: 2022-06-20 21:40 Last Update: 2022-06-28 13:43

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
2

Details

First of all the code in question causes compiler warning (with some compilers) when FREECIV_DEBUG is not defined - set of variables are only used in log_debug(), which expands to nothing without FREECIV_DEBUG, so otherwise those variables are "set but unused". This should be cleared also for optimization reasons, so that we don't calculate those unused stats.

Even if the log_debug() would show the stats, calculated ones are not per-player as one would assume from the player name and other player-specific ones. Those stats are zeroed only before iterating the players, not for each player, so they accumulate over players iterated.

Ticket History (3/5 Histories)

2022-06-20 21:40 Updated by: cazfi
  • New Ticket "end_turn() debug statistics cumulative, not per player" created
2022-06-22 01:44 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 3.0.3 (closed)
2022-06-28 13:43 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Attachment File List

Edit

Please login to add comment to this ticket » Login