mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 22:06:05 -04:00
Automated atomic bombs no longer cause crashes
This commit is contained in:
parent
c327b54b1b
commit
d262c1a6ea
@ -1287,7 +1287,7 @@
|
||||
"Blast radius [2]"],
|
||||
"attackSound": "nuke"
|
||||
// Plane rather than a missile - can be based in city or Carrier only.
|
||||
// Can be intercepted, be must die for it not to take effect.
|
||||
// Can be intercepted, but must die for it not to take effect.
|
||||
},
|
||||
{
|
||||
"name": "Rocket Artillery",
|
||||
|
@ -111,7 +111,7 @@ object UnitAutomation {
|
||||
if (unit.type == UnitType.Bomber)
|
||||
return SpecificUnitAutomation.automateBomber(unit)
|
||||
|
||||
if (unit.type == UnitType.Missile)
|
||||
if (unit.type == UnitType.Missile || unit.type == UnitType.AtomicBomber)
|
||||
return SpecificUnitAutomation.automateMissile(unit)
|
||||
|
||||
|
||||
|
@ -13,7 +13,6 @@ import com.unciv.models.ruleset.Unique
|
||||
import com.unciv.models.ruleset.tile.TileImprovement
|
||||
import com.unciv.models.ruleset.unit.BaseUnit
|
||||
import com.unciv.models.ruleset.unit.UnitType
|
||||
import com.unciv.models.translations.getPlaceholderParameters
|
||||
import java.text.DecimalFormat
|
||||
import kotlin.math.pow
|
||||
import kotlin.random.Random
|
||||
@ -675,7 +674,8 @@ class MapUnit {
|
||||
|
||||
fun putInTile(tile: TileInfo) {
|
||||
when {
|
||||
!movement.canMoveTo(tile) -> throw Exception("I can't go there!")
|
||||
!movement.canMoveTo(tile) ->
|
||||
throw Exception("I can't go there!")
|
||||
type.isAirUnit() || type.isMissile() -> tile.airUnits.add(this)
|
||||
type.isCivilian() -> tile.civilianUnit = this
|
||||
else -> tile.militaryUnit = this
|
||||
|
Loading…
x
Reference in New Issue
Block a user