yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.49k stars 1.58k forks source link

Bug Report: Infantry can't be upgraded to Mechanized Infantry and upgradesTo unexpected behaviors using both "requiredTech" or "Only available" #8214

Closed AceHank closed 1 year ago

AceHank commented 1 year ago

Platform Windows 10 64bit

Version 4.3.11-upgrade-redone

Describe the bug Using "requiredTech" method to upgrades a unit, all is fine and well until you can't upgrade into the last unit in the line. For example, I'm using Infantry.

Using "Only available" method to upgrades a unit, is not doable at all, since it will always skips over all the upgrades in the line straight into the second from the latest, ignoring all conditional added.

To Reproduce I've uploaded Upgrade Test mod to make it easier and faster to reproduce.

To reproduce Infantry can't be upgraded to Mechanized:

  1. Select the mod nation "Infantry can't be Mechanized"
  2. Starts in Modern era
  3. Notice that you can upgrade Rifleman->Great War Infantry->Infantry, but you can't upgrade Infantry->Mechanized (aka, the last upgrade in the line).

This seems to be the case with other units, as I tried using Machine Gun and TU 1 until TU 4 as modded unit line using "requiredTech" and it has the same behavior as above. Might also be the case for issue #8209 where Frigate can't be upgraded into Battleship which is the last upgrade in the line.

To reproduce "Only available":

  1. Starts in ancient era, use any nation
  2. Build the "Construct Test Unit 1" building (which uses "Only available" method)
  3. Continue playing until several turns and notice that all the various conditional in "Test Unit" line is ignored and go straight into the second from latest upgrade. And still can't be upgraded into the last upgrade in the line, same behavior as above.

Screenshots Mobile Tactics can be seen completed but no upgrade button to be found. image

Test Unit 1 upgrades straight into Test Unit 5 image

Additional Context In "Test Unit" line, I'm using mixed up conditional for the "Only available" for testing purposes. The actual units I'm modding are using "Only available starting from era".

Thank you as always! And sorry for spamming issues these last few days.

Upgrade Test.zip

yairm210 commented 1 year ago

Should be solved in new version rolling out, 4.3.1-upgrade-redone-2

AceHank commented 1 year ago

Thank you very much!

yairm210 commented 1 year ago

Awaiting your confirmation to reuse the next version ;)

AceHank commented 1 year ago

The unable to upgrade to last in the line is fixed.

But it still skips to the last upgrade when using "Only available" method. Now it can be upgraded to "Test Unit 6" where before only to "Test Unit 5". All kind of conditionals with "Only available" are still ignored. image

Sorry and thank you for your trouble. I can't thank you enough 👍

yairm210 commented 1 year ago

That's right, that's the plan It skips over unbuildable middle-man units to get the last available buildable unit So that's On Spec :)