From e2187a268f56376892a9e0ed6a6f74e7284dfd03 Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Fri, 23 Sep 2022 13:16:29 +0200 Subject: [PATCH] Fixed crash when getting a spy and expanding a city simultaneously (#7849) --- core/src/com/unciv/logic/civilization/EspionageManager.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/civilization/EspionageManager.kt b/core/src/com/unciv/logic/civilization/EspionageManager.kt index aa2dd986dc..de7af412dc 100644 --- a/core/src/com/unciv/logic/civilization/EspionageManager.kt +++ b/core/src/com/unciv/logic/civilization/EspionageManager.kt @@ -127,7 +127,9 @@ class EspionageManager : IsPartOfGameInfoSerialization { fun addSpy(): String { val spyName = getSpyName() - spyList.add(Spy(spyName)) + val newSpy = Spy(spyName) + newSpy.setTransients(civInfo) + spyList.add(newSpy) ++spyCount return spyName }