HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...
Bug #880780

Literacy value in Demographics can show insane values if a player loses cities during a turn.
0%
Description
get_literacy()
uses the current population to calculate the literacy rate shown in demographics (instead of the pop at turn change, which is shown in the population line in demographics). Since it also uses pplayer->score.literacy
which doesn't update immediately, losing cities can make the shown numbers go completely off track. In a particular game numbers like 402 % and 2328 % were seen for one player. This can also leak information about a player's city losses in advance.
get_mil_service()
similarly uses pplayer->score.units
with civ_population()
.
Should probably use the same number as get_population()
does for both.
https://github.com/freeciv/freeciv/blob/S2_6/common/achievements.c#L384
https://github.com/freeciv/freeciv/blob/S2_6/server/report.c#L548
Tested with 2.6, looks the same in master.
History
#1
Updated by Marko Lindqvist about 1 year ago
- Sprint/Milestone set to 2.6.4
Setting 2.6.4 as target to indicate this should be fixed during S2_6 lifetime. 2.6.4 is the only active version we have of S2_6. It's quite likely this gets postponed to later release once their version gets defined to the system.
#2
Updated by Anonymous about 1 year ago
- File 0001-Use-pop-at-turn-change-to-calculate-Demographics-Lit.patch 0001-Use-pop-at-turn-change-to-calculate-Demographics-Lit.patch added
Patch for 2.6.
#3
Updated by Anonymous about 1 year ago
- File 0001-Use-pop-at-turn-change-to-calculate-Demographics-Lit.patch 0001-Use-pop-at-turn-change-to-calculate-Demographics-Lit.patch added
Same for master
#4
Updated by Marko Lindqvist about 1 year ago
- Tracker changed from Task to Bug
- Category set to Server
#5
Updated by Marko Lindqvist about 1 year ago
- Status changed from New to Resolved
- Assignee set to Marko Lindqvist
#6
Updated by Marko Lindqvist about 1 year ago
I think the bug also affects gaining of Literate achievement. One could get it in the end of the turn where one lost cities causing miscalculation of the literacy value.
#7
Updated by Marko Lindqvist about 1 year ago
- Status changed from Resolved to Closed