Skip to content

Commit

Permalink
Check non-null when removing road (fix #8249) (#8250)
Browse files Browse the repository at this point in the history
  • Loading branch information
CrispyXYZ authored Dec 28, 2022
1 parent 84fe92f commit 0519b92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/com/unciv/logic/map/TileInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,11 @@ open class TileInfo : IsPartOfGameInfoSerialization {

// function handling when removing a road from the tile
fun removeRoad() {
roadStatus = RoadStatus.None
roadIsPillaged = false
if (roadStatus == RoadStatus.None) return
roadStatus = RoadStatus.None
if (owningCity == null)
getRoadOwner()!!.neutralRoads.remove(this.position)
getRoadOwner()?.neutralRoads?.remove(this.position)
}

fun getShownImprovement(viewingCiv: CivilizationInfo?): String? {
Expand Down

0 comments on commit 0519b92

Please sign in to comment.