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...
Bug #884993
closedimpr_req for unittype doesn't work for Small Wonders
0%
Description
cause of bug:
city.c:
can_player_build_unit_direct()
This function does some pre-screening to check unittype can be made. Some pre-screening is incomplete tests on if the unittype has an impr_req.
The pre-screening tested two things:
1. if impr_req is a player-owned Great Wonder and does player own that Great Wonder
2. if the player-nation as a whole is allowed to build this type of improvement (if not then we don't have to check
individual cities later.)
Oops, an exception falls through the cracks here.
Problem: a Small Wonder can't be built if the player already made the Small Wonder. So under the above logic, if you have a SmallWonder, you are prohibited from making a unittype because you already have the SmallWonder. So owning the SmallWonder imprv_req makes you fail the pre-screening to test if you can make a unit that needs a SmallWonder for its imprv_req.
FCW has fixed this bug here:
https://github.com/Lexxie9952/fcw.org-server/commit/99c31b00c5d788ee9b49b141098f0a1a5341676b
Files
Related issues
Updated by Alexandro Ignatiev almost 3 years ago
Note: the bug is invoked only in rulesets where small wonders require absence of themselves (otherwise player is supposed to be able to build another one). But yes it's a bug.
Updated by Lexxie L almost 3 years ago
Alexandro Ignatiev wrote:
Note: the bug is invoked only in rulesets where small wonders require absence of themselves (otherwise player is supposed to be able to build another one). But yes it's a bug.
It is almost ALWAYS true that a city that already has a Small Wonder, isn't allowed to make it again. Otherwise all the wonders it already has will show in its possible list of production choices.
Therefore, I can't imagine a case where this isn't true. Only the city that has the Small Wonder is allowed to make a certain unit. But the city isn't allowed to make the Small Wonder because it already has it. So because of this, this function will ALWAYS fail when a ruleset makes a Small Wonder as a requirement to build a certain kind of unit.
Updated by Marko Lindqvist over 2 years ago
Lexxie L wrote:
Alexandro Ignatiev wrote:
Note: the bug is invoked only in rulesets where small wonders require absence of themselves (otherwise player is supposed to be able to build another one). But yes it's a bug.
It is almost ALWAYS true that a city that already has a Small Wonder, isn't allowed to make it again.
In the original description you said that the problematic test is if "player-nation as a whole" is allowed to make the wonder, here you talk about the specific city that has the Small Wonder.
But I guess all this is only about the scope of the bug, not about the existence of the bug.
Updated by Marko Lindqvist over 2 years ago
- File 0028-Fix-Small-Wonder-impr_req-for-units.patch 0028-Fix-Small-Wonder-impr_req-for-units.patch added
- File 0016-Fix-Small-Wonder-impr_req-for-units.patch 0016-Fix-Small-Wonder-impr_req-for-units.patch added
- Status changed from New to Resolved
Can you test if attached patch helps? Compared to fcw one it retains the buildability check for the case when the Small Wonder has not been built.
Updated by Marko Lindqvist over 2 years ago
Marko Lindqvist wrote:
Can you test if attached patch helps? Compared to fcw one it retains the buildability check for the case when the Small Wonder has not been built.
I there's no reply within next 48 hours, assuming it's ok.
Updated by Marko Lindqvist over 2 years ago
- Status changed from Resolved to Closed
- Assignee set to Marko Lindqvist
Updated by Marko Lindqvist over 2 years ago
- Related to Bug #846784: An existing building may not fulfill impr_req added