Project

Profile

Help

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

impr_req for unittype doesn't work for Small Wonders

Added by Lexxie L 12 months ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Category:
Server
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

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


Related issues

Related to Freeciv - Bug #846784: An existing building may not fulfill impr_reqNew

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Alexandro Ignatiev 12 months 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.

#2 Updated by Lexxie L 11 months 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.

#3 Updated by Marko Lindqvist 11 months ago

  • Sprint/Milestone set to 2.6.3

#4 Updated by Marko Lindqvist 11 months 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.

#5 Updated by Marko Lindqvist 9 months ago

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.

#6 Updated by Marko Lindqvist 9 months 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.

#7 Updated by Marko Lindqvist 9 months ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

#8 Updated by Marko Lindqvist 9 months ago

  • Related to Bug #846784: An existing building may not fulfill impr_req added

Also available in: Atom PDF