mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Solved bug which was caused by obsoleting scouts when they have no upgrade
This commit is contained in:
parent
82d8670b16
commit
33ad922343
@ -788,6 +788,20 @@ ImprovementIcons/Quarry
|
|||||||
orig: 100, 100
|
orig: 100, 100
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
|
ImprovementIcons/Railroad
|
||||||
|
rotate: false
|
||||||
|
xy: 308, 238
|
||||||
|
size: 100, 100
|
||||||
|
orig: 100, 100
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
TileSets/Default/Railroad
|
||||||
|
rotate: false
|
||||||
|
xy: 308, 238
|
||||||
|
size: 100, 100
|
||||||
|
orig: 100, 100
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
ImprovementIcons/Road
|
ImprovementIcons/Road
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 1838, 170
|
xy: 1838, 170
|
||||||
@ -1714,7 +1728,7 @@ TechIcons/Radio
|
|||||||
index: -1
|
index: -1
|
||||||
TechIcons/Railroad
|
TechIcons/Railroad
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 308, 238
|
xy: 2, 226
|
||||||
size: 100, 100
|
size: 100, 100
|
||||||
orig: 100, 100
|
orig: 100, 100
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@ -1789,6 +1803,20 @@ TileSets/Default/CityOverlay
|
|||||||
orig: 100, 100
|
orig: 100, 100
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
|
TileSets/Default/CrosshatchHexagon
|
||||||
|
rotate: false
|
||||||
|
xy: 583, 1800
|
||||||
|
size: 273, 236
|
||||||
|
orig: 273, 236
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
TileSets/FantasyHex/CrosshatchHexagon
|
||||||
|
rotate: false
|
||||||
|
xy: 583, 1800
|
||||||
|
size: 273, 236
|
||||||
|
orig: 273, 236
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
TileSets/Default/FalloutOverlay
|
TileSets/Default/FalloutOverlay
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 2, 1042
|
xy: 2, 1042
|
||||||
@ -1859,37 +1887,9 @@ TileSets/Default/OasisOverlay
|
|||||||
orig: 100, 100
|
orig: 100, 100
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
TileSets/Default/Railroad
|
|
||||||
rotate: false
|
|
||||||
xy: 410, 214
|
|
||||||
size: 100, 100
|
|
||||||
orig: 100, 100
|
|
||||||
offset: 0, 0
|
|
||||||
index: -1
|
|
||||||
ImprovementIcons/Railroad
|
|
||||||
rotate: false
|
|
||||||
xy: 410, 214
|
|
||||||
size: 100, 100
|
|
||||||
orig: 100, 100
|
|
||||||
offset: 0, 0
|
|
||||||
index: -1
|
|
||||||
TileSets/FantasyHex/CrosshatchHexagon
|
|
||||||
rotate: false
|
|
||||||
xy: 583, 1800
|
|
||||||
size: 273, 236
|
|
||||||
orig: 273, 236
|
|
||||||
offset: 0, 0
|
|
||||||
index: -1
|
|
||||||
TileSets/Default/CrosshatchHexagon
|
|
||||||
rotate: false
|
|
||||||
xy: 583, 1800
|
|
||||||
size: 273, 236
|
|
||||||
orig: 273, 236
|
|
||||||
offset: 0, 0
|
|
||||||
index: -1
|
|
||||||
TileSets/FantasyHex/Railroad
|
TileSets/FantasyHex/Railroad
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 2, 226
|
xy: 410, 214
|
||||||
size: 100, 100
|
size: 100, 100
|
||||||
orig: 100, 100
|
orig: 100, 100
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
@ -2957,6 +2957,20 @@ TechIcons/Writing
|
|||||||
orig: 100, 100
|
orig: 100, 100
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
|
TileSets/Default/road
|
||||||
|
rotate: false
|
||||||
|
xy: 512, 90
|
||||||
|
size: 61, 11
|
||||||
|
orig: 61, 11
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
TileSets/FantasyHex/road
|
||||||
|
rotate: false
|
||||||
|
xy: 512, 90
|
||||||
|
size: 61, 11
|
||||||
|
orig: 61, 11
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
TileSets/FantasyHex/Tiles/Academy
|
TileSets/FantasyHex/Tiles/Academy
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 818, 13
|
xy: 818, 13
|
||||||
@ -4252,20 +4266,6 @@ TileSets/FantasyHex/Units/Work Boats
|
|||||||
orig: 32, 26
|
orig: 32, 26
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
TileSets/FantasyHex/road
|
|
||||||
rotate: false
|
|
||||||
xy: 512, 90
|
|
||||||
size: 61, 11
|
|
||||||
orig: 61, 11
|
|
||||||
offset: 0, 0
|
|
||||||
index: -1
|
|
||||||
TileSets/Default/road
|
|
||||||
rotate: false
|
|
||||||
xy: 512, 90
|
|
||||||
size: 61, 11
|
|
||||||
orig: 61, 11
|
|
||||||
offset: 0, 0
|
|
||||||
index: -1
|
|
||||||
UnitIcons/Submarine
|
UnitIcons/Submarine
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 2, 104
|
xy: 2, 104
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 877 KiB After Width: | Height: | Size: 877 KiB |
@ -25,7 +25,6 @@
|
|||||||
movement:2,
|
movement:2,
|
||||||
strength:5,
|
strength:5,
|
||||||
cost:25,
|
cost:25,
|
||||||
obsoleteTech:"Scientific Theory",
|
|
||||||
uniques:["Ignores terrain cost"],
|
uniques:["Ignores terrain cost"],
|
||||||
attackSound:"nonmetalhit"
|
attackSound:"nonmetalhit"
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,13 @@ package de.tomgrill.gdxtesting.examples;
|
|||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.unciv.UncivGame;
|
import com.unciv.UncivGame;
|
||||||
import com.unciv.models.ruleset.Ruleset;
|
import com.unciv.models.ruleset.Ruleset;
|
||||||
|
import com.unciv.models.ruleset.unit.BaseUnit;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
import de.tomgrill.gdxtesting.GdxTestRunner;
|
import de.tomgrill.gdxtesting.GdxTestRunner;
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
@ -37,6 +40,21 @@ public class BasicTests {
|
|||||||
&& !new UncivGame("").getViewEntireMapForDebug());
|
&& !new UncivGame("").getViewEntireMapForDebug());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there's a unit that obsoletes with no upgrade then when it obsoletes
|
||||||
|
// and we try to work on its upgrade, we'll get an exception - see techManager
|
||||||
|
@Test
|
||||||
|
public void allObsoletingUnitsHaveUpgrades() {
|
||||||
|
Collection<BaseUnit> units = new Ruleset(true).getUnits().values();
|
||||||
|
boolean allObsoletingUnitsHaveUpgrades = true;
|
||||||
|
for(BaseUnit unit : units){
|
||||||
|
if(unit.getObsoleteTech()!=null && unit.getUpgradesTo()==null) {
|
||||||
|
System.out.println(unit.name+" obsoletes but has no upgrade");
|
||||||
|
allObsoletingUnitsHaveUpgrades=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assertTrue(allObsoletingUnitsHaveUpgrades);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
// public void setMapEditorScreen() {
|
// public void setMapEditorScreen() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user