Use state loaded checks in raw rewind (#8195)

This commit is contained in:
2026-06-26 07:29:18 -07:00
committed by GitHub
parent 52afd836ac
commit cbe71f4fd4
@@ -2523,7 +2523,7 @@ class GamesManager(
case Some(error) => Left(error)
case None =>
// If game is loaded, unload it only after the target is validated — rewind will invalidate in-memory state.
if gameControllerInfos.contains(gameId) then {
if state.hasControllerInfo(gameId) then {
shardokClient.cancelBattlesForGame(gameId)
unloadGame(gameId): Unit
}
@@ -2545,7 +2545,7 @@ class GamesManager(
}
// If game is loaded, unload it — rewind will invalidate in-memory state
if gameControllerInfos.contains(gameId) then {
if state.hasControllerInfo(gameId) then {
shardokClient.cancelBattlesForGame(gameId)
unloadGame(gameId): Unit
}