mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 04:43:05 -04:00
Resolved #12524 - only add city ruins improvements if they exist in the ruleset
This commit is contained in:
parent
62480c5d92
commit
6b64bc6f1a
@ -353,7 +353,9 @@ class City : IsPartOfGameInfoSerialization, INamed {
|
||||
if (isCapital()) civ.moveCapitalToNextLargest(null)
|
||||
|
||||
civ.cities = civ.cities.toMutableList().apply { remove(this@City) }
|
||||
getCenterTile().setImprovement("City ruins")
|
||||
|
||||
if (getRuleset().tileImprovements.containsKey("City ruins"))
|
||||
getCenterTile().setImprovement("City ruins")
|
||||
|
||||
// Edge case! What if a water unit is in a city, and you raze the city?
|
||||
// Well, the water unit has to return to the water!
|
||||
|
@ -42,7 +42,8 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
||||
var interceptRange = 0
|
||||
var unitType: String = ""
|
||||
|
||||
val type by lazy { ruleset.unitTypes[unitType]!! }
|
||||
val type by lazy { ruleset.unitTypes[unitType]
|
||||
?: throw Exception("Unit $name has unit type $unitType which is not present in ruleset!") }
|
||||
override var requiredTech: String? = null
|
||||
var requiredResource: String? = null
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user