#42993: Wonders needlessly hard-coded to override the building upkeep specified in the ruleset. Open Date: 2021-10-07 19:09 Last Update: 2022-01-16 17:29 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/42993 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=42993 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-01-16 17:29 Updated by: lexxie9952 Comment: It would then not be upkeep removal, but would turn to a profit in cities that don't have another other building upkeep. We modified the return statement in this function /**********************************************************************//** Returns the total amount of gold needed to pay for all buildings in the city. **************************************************************************/ int city_total_impr_gold_upkeep(const struct city *pcity) { int gold_needed = 0; if (!pcity) { return 0; } city_built_iterate(pcity, pimprove) { gold_needed += city_improvement_upkeep(pcity, pimprove); } city_built_iterate_end; // Negative upkeep buildings provide infrastructural support on the // upkeep of other buildings but can't result in negative gold_needed: return gold_needed > 0 ? gold_needed : 0; } The effect is it reduces upkeep by up to that amount but never turns into a profit. I don't mind doing some other way that creates the same result. But it is clearly not meant to be a profit, but a "removal of up to X from the sum of upkeeps of other buildings". --------------------------------------------------------------------- Ticket Status: Reporter: lexxie9952 Owner: (None) Type: Bugs Status: Open Priority: 5 - Medium MileStone: (None) Component: (None) Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: This bug was probably never found because the vast majority of wonders have 0 upkeep. However, rulesets allow the ruleset designer to set the upkeep for any building or wonder. There is no need for the server to hard-code 0 upkeep for wonders to override the ruleset values. file: city.js function: int city_improvement_upkeep(const struct city *pcity, const struct impr_type *b) blamed lines: if (is_wonder(b)) { return 0; } -- Ticket information of Freeciv project Freeciv Project is hosted on OSDN Project URL: https://osdn.net/projects/freeciv/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/freeciv/ticket/42993 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=42993