Patch fix for crash, from Discord - @WhoIsJohannes

This commit is contained in:
Yair Morgenstern 2023-04-17 21:03:05 +03:00
parent 4eea7984f7
commit 958318e53b

View File

@ -334,8 +334,7 @@ object UnitAutomation {
}
private fun startGoldenAgeIfHasAbility(unit: MapUnit) {
UnitActions.getUnitActions(unit).filter { it.type == UnitActionType.StartGoldenAge }
.firstOrNull()?.action!!.invoke()
UnitActions.getUnitActions(unit).firstOrNull { it.type == UnitActionType.StartGoldenAge }?.action?.invoke()
}
/** @return true only if the unit has 0 movement left */