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...
Feature #856260
Rework city dialog sum breakdowns to remove duplicate descriptions, etc
0%
Description
A thing I noticed with the attached experimental savegame was that the plague risk breakdown had two lines with identical descriptions, "Bonus from Aqueduct".
This is because there are two separate effects clauses in effect (one is an additional bonus for Aqueduct before Industrialization), but the effect summary text doesn't mention Industrialization (and nor should it try, probably).
The attached rework merges such duplicate entries, by accumulating the breakdown in a "city_sum" structure. Other benefits of this:- Gets rid of the duplicate running-total logic that's been a source of bugs (e.g. bug #854306).
- Centralises logic for spotting when the client has incomplete knowledge (added in gna bug #21442).
I've also made it so that the plague risk breakdown shows the bonus value from effects, like e.g. Gold (e.g. "-4.7% : Bonus from Aqueduct+Sewer System (-20%)". (This does show two separate percentages, but I think we are saved from confusion by the second one typically being obviously round numbers matching what you see in the online help.)
One possibly contentious point is the use of two __format(__printf__)
qualifiers on a single function with two format strings. My GCC (8.3.0) accepts this and does the right thing with it, but I haven't checked whether it might be a portability hazard.
This touches quite a few strings.
Related issues
History
#1
Updated by Jacob Nevins about 1 year ago
- Blocked by Feature #856256: Expose varargs method for astring added
#2
Updated by Jacob Nevins about 1 year ago
- File m-citysum.patch m-citysum.patch added
- File 30-citysum.patch 30-citysum.patch added
- File 26-citysum.patch 26-citysum.patch added
- Status changed from In Progress to Resolved
#3
Updated by Jacob Nevins almost 1 year ago
- Status changed from Resolved to Closed
#4
Updated by Jacob Nevins 12 months ago
One possibly contentious point is the use of two
__format(__printf__)
qualifiers on a single function
(I mentioned this to a friend and they confirmed that Clang does the right thing with this too.)
#5
Updated by Jacob Nevins 11 months ago
- Related to Bug #859209: citydlg_common.c uses va_list, but does not include stdarg.h added