From 84a06b7fcbdc23c4a3ab869095e4f34fed2c7922 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 5 Jul 2020 00:22:17 +0300 Subject: [PATCH] Reset ruleset when entering main menu screen, so that all map elements for the background will be available after returning from a modded game that removed some of them --- core/src/com/unciv/MainMenuScreen.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/com/unciv/MainMenuScreen.kt b/core/src/com/unciv/MainMenuScreen.kt index 6a60fe93b5..0edb25e090 100644 --- a/core/src/com/unciv/MainMenuScreen.kt +++ b/core/src/com/unciv/MainMenuScreen.kt @@ -41,6 +41,11 @@ class MainMenuScreen: CameraStageBaseScreen() { stage.addActor(backgroundTable) backgroundTable.center(stage) + // If we were in a mod, some of the resource images for the background map we're creating + // will not exist unless we reset the ruleset and images + ImageGetter.ruleset = RulesetCache.getBaseRuleset() + ImageGetter.refreshAtlas() + thread(name="ShowMapBackground") { val newMap = MapGenerator(RulesetCache.getBaseRuleset()) .generateMap(MapParameters().apply { size = MapSize.Small; type=MapType.default })