mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-13 12:27:40 +07:00
Fixed an infinite loop where foreign legion upgraded to the unit it replaced (#5808)
* Fixed an infinite loop where foreign legion upgraded to the unit it replaced * Changed the wrong variable * Maybe it is useful to also change its unlock tech * Whoops, should only be for non-null values
This commit is contained in:
parent
a7b880c033
commit
58cc3b517e
@ -914,12 +914,12 @@
|
||||
{
|
||||
"name": "Foreign Legion",
|
||||
"unitType": "Gunpowder",
|
||||
"replaces": "Infantry",
|
||||
"replaces": "Rifleman",
|
||||
"uniqueTo": "France",
|
||||
"movement": 2,
|
||||
"strength": 50,
|
||||
"cost": 320,
|
||||
"requiredTech": "Replaceable Parts",
|
||||
"requiredTech": "Rifling",
|
||||
"upgradesTo": "Infantry",
|
||||
"obsoleteTech": "Plastics",
|
||||
"uniques": ["[+20]% Strength <when fighting in [Foreign Land] tiles>"],
|
||||
|
@ -767,7 +767,7 @@ object NextTurnAutomation {
|
||||
unit.baseUnit.isRanged() -> rangedUnits.add(unit)
|
||||
unit.baseUnit.isMelee() -> meleeUnits.add(unit)
|
||||
unit.hasUnique("Bonus for units in 2 tile radius 15%")
|
||||
-> generals.add(unit) //generals move after military units
|
||||
-> generals.add(unit) // Generals move after military units
|
||||
else -> civilianUnits.add(unit)
|
||||
}
|
||||
}
|
||||
|
@ -373,7 +373,7 @@ class Ruleset {
|
||||
// When not checking the entire ruleset, we can only really detect ruleset-invariant errors in uniques
|
||||
|
||||
for (unit in units.values) {
|
||||
if (unit.upgradesTo == unit.name)
|
||||
if (unit.upgradesTo == unit.name || (unit.upgradesTo != null && unit.upgradesTo == unit.replaces))
|
||||
lines += "${unit.name} upgrades to itself!"
|
||||
if (!unit.isCivilian() && unit.strength == 0)
|
||||
lines += "${unit.name} is a military unit but has no assigned strength!"
|
||||
|
Loading…
Reference in New Issue
Block a user