Skip to content

Fix double-counting of commerce in treasury flows (#864) - #995

Open
Billytifft wants to merge 1 commit into
C7-Game:Developmentfrom
Billytifft:billy/city-commerce
Open

Billytifft wants to merge 1 commit into
C7-Game:Developmentfrom
Billytifft:billy/city-commerce

Conversation

@Billytifft

Copy link
Copy Markdown
Contributor

Fixes the broken income/expense totals on the Domestic Advisor described in #864.

Problem

PlayerCommerceBreakdown.Inflows() and Outflows() both included corrupted, beakers, and happiness. Those are allocations of a city's commerce, not treasury gold, so they appeared twice: once on the income side and once on the expense side of the advisor's totals. Netflows() happened to be numerically correct because the duplicates cancelled out, so gold-per-turn was never actually wrong.

Fix

  • Inflows() is now gold income only: taxes + taxmenTaxes + fromOtherCivs + interest + wealthProduction
  • Outflows() is now gold expenses only: toOtherCivs + maintenance + unitSupport
  • Added CommerceTotal() for the full pre-split city commerce figure
  • Domestic Advisor: "From cities" shows taxes + wealthProduction (real gold from cities) instead of the old total-commerce CityInflows(), and the expense lines keep the exact line order Civ3 uses (Science, Entertainment, Corruption, Maintenance, Unit costs, To other civs)

Tests

Added PlayerCommerceBreakdownTest covering the gold-only inflow/outflow math and CommerceTotal. Full suite passes locally (73 tests, Civ3 install enabled).

No behavioral change to gold-per-turn; only the reported breakdown is corrected.

Inflows() and Outflows() both counted corruption, science and
entertainment income. These are allocations of a city's commerce,
not treasury gold, so they appeared twice in the domestic advisor's
income and expense totals. Netflows() was unaffected because the
duplicate terms cancelled out.

Make Inflows()/Outflows() gold-only, add CommerceTotal() for the
full city commerce figure, and have the domestic advisor show taxes
plus wealth production as income from cities while keeping the
Civ3 line order for the expense breakdown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant