From 958318e53b198aab933ee1d9141e78cd4197e842 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 17 Apr 2023 21:03:05 +0300 Subject: [PATCH] Patch fix for crash, from Discord - @WhoIsJohannes --- core/src/com/unciv/logic/automation/unit/UnitAutomation.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt index c2ba6b868b..0ba6de4f6b 100644 --- a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt @@ -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 */