Consistent NoUpgrade flag

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
User avatar
soundnfury
Posts: 28
Joined: Sat Apr 11, 2020 12:09 pm

Consistent NoUpgrade flag

Post by soundnfury »

In my ruleset, I have a NoUpgrade flag that controls the Upgrade action, so that some units can be obsoleted (to declutter the build list) without being able to be upgraded (which e.g. in some cases bypasses an impr_req on the new unit).

Code: Select all

[actionenabler_upgrade_unit]
action = "Upgrade Unit"
actor_reqs    =
    { "type",    "name",       "range", "present"
      "DiplRel", "Foreign",    "Local", FALSE
      "UnitFlag", "NoUpgrade", "Local", FALSE
    }
However, if I have three units X → Y → Z (where → represents obsolete_by), and Y has the NoUpgrade flag, an X can still be directly upgraded to Z; I don't see any way to work around this.

So my request is that the Upgrade Unit action should check that the entire chain of obsolete_by would all pass the actionenabler individually (and if not, upgrade to the point where it fails, so that e.g. X can still upgrade to Y after inventing Z), rather than just looking at the endpoints.
Creator of the Aviation ruleset. Try it out today!
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Consistent NoUpgrade flag

Post by cazfi »

Sounds like a real glitch. Please open a ticket: https://osdn.net/projects/freeciv/ticket/
User avatar
soundnfury
Posts: 28
Joined: Sat Apr 11, 2020 12:09 pm

Re: Consistent NoUpgrade flag

Post by soundnfury »

Creator of the Aviation ruleset. Try it out today!
Post Reply