Bug #2087
closedobsolete buildings only sold off when new tech
0%
Description
reported by John Campbell on the forum -
https://forum.freeciv.org/f/viewtopic.php?t=95525
You can make buildings obsolete_by other buildings, but that's only checked and the obsolete building sold off when new tech discovered.
Files
Updated by Dean Brown about 1 month ago
- File 2087.patch added
Related issue - all req types are currently accepted by obsolete_by requirement vectors
without any checking, and could be nonsensical or could change back, e.g.
type Gov, if Democracy obsoletes a building and it doesn't get sold off before
the Gov changes again, the building becomes not obsolete. I think obsolete_by requirement vectors
should only allow one-way ratchet type req types. Needs a separate issue.
Updated by Marko Lindqvist about 1 month ago
- Blocks Tasks #1631: S3_3 datafileformat freeze (d3f) added
Updated by Dean Brown about 1 month ago
- File 2087.patch added
Thought about it some more and changed my mind. In the real world "obsolete" is permanent, but in the freeciv world it isn't, a tech can get lost or a building sabotaged, and suddenly an improvement becomes non-obsolete again. So forget about one-way ratchet type req types. And yes some req types are nonsensical for obsolete_by, but there's also plenty of effect types for which some req types are nonsensical and we just silently ignore them. So forget about screening req types for obsolete_by. The nonsensical req types are also not likely to ever get used.
I think it's worthwhile generalizing handling of selling obsolete buildings, beyond just obsolete_by req types "Tech" & "Building". The others I think most likely to ever get used are "Achievement" & "Age". To handle "Age", remove_obsolete_buildings(pplayer) needs to be called every turn. Doing it that way covers all possible req types. That call has to be near the end of end_phase() after everything has happened that could affect obsolete_by reqs.
Updated by Marko Lindqvist about 1 month ago
- Status changed from New to In Review
- Assignee set to Marko Lindqvist
Updated by Marko Lindqvist about 1 month ago
Just a note (maybe for NEWS), I'm not against the patch:
This introduces a rule change that buildings now provide full benefit still at the turn they are sold (since selling now happens later).
Updated by Dean Brown about 1 month ago
Yes, and also the gold upkeep gets charged.
Thought it would be nice if the selling off could happen before paying for it, but completing a building happens much earlier in the new turn processing, before achievements are checked and turn counter incremented.
Updated by Marko Lindqvist about 1 month ago
- Blocks Tasks #2116: S3_3-alpha3 added