Wonders needlessly hard-coded to override the building upkeep specified in the ruleset.
When ever I've seen that part of the code, I've assumed that it's there for never ending to a situation where a Wonder would get sold for lack of funds. I've meant to check if server could nowadays handle selling of a wonder so that we could lift this restriction that wonders have no upkeep. It probably could - wonders just provide effects, and as those same effects could come from other sources more likely to disappear, the server must be prepared for their disappearance. The check here is ancient - predates introduction of the effects system in freeciv-2.0, probably even ruleset provided buildings data.
As a quick test I removed the check, set Colossus upkeep to 50 so it would drain my balance to negative in a couple of turns, started game, founded my first city, set Colossus there in the editor, did "Turn Done" twice -> client shows negative balance for me, and server crashed.
Well, to allow wonders to have upkeep we should either make them sellable or handle negative treasury. I think we should have a special flag or even genus of "semi-wonders" that are unique for a player in a given moment but may be sold (like commercial Civ* Palace) or require upkeep. Alternatively, we could just have buildings count requirement somehow.
So, the check is there for a reason and *not* needless. There is an issue with the current implementation that this override is silent, not warning ruleset author about the fact that things don't work quite like s/he expects. Will open a new ticket about that. Keeping this ticket for any future development to allow nonzero wonder upkeep.
I removed it and now can happily make upkeep for wonders. In this case, negative upkeep as a bonus for a certain wonder.
First step towards this is #43556
So this seems to be angled toward not allowing upkeep unless a building is sellable.
I am not sure if this is following a plan for compatibility with FCW and MP2 rulesets.
In particular, we have a wonder with negative upkeep (Hoover Dam) which relieves upkeep for other buildings in its own city.
I believe I see the case that bothers you. Someone has negative upkeep and here is no other building to sell that's left except a wonder.
Disallowing wonder upkeep for this almost never occurring case, it's not ideal. But I suppose you are thinking a special flag for wonders with upkeep that if they have positive upkeep they must be sellable. As ruleset designer I should have liked a discussion on where we might go with it.
Reply To lexxie9952
In particular, we have a wonder with negative upkeep (Hoover Dam) which relieves upkeep for other buildings in its own city.
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 /**********************************************************************//**
**************************************************************************/ int city_total_impr_gold_upkeep(const struct city *pcity) {
}
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".
Won't make it to 3.2, which is going to d3f as soon as possible.
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: