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

This commit is contained in:
Yair Morgenstern 2020-07-05 00:22:17 +03:00
parent c94079c0a7
commit 84a06b7fcb

View file

@ -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 })