Better loading of stuff

This commit is contained in:
Yair Morgenstern 2020-08-14 16:33:09 +03:00
parent 15bca9cc1c
commit 7efbe6feb2
2 changed files with 4 additions and 1 deletions

View File

@ -71,6 +71,7 @@ class Ruleset {
unitPromotions.putAll(ruleset.unitPromotions)
units.putAll(ruleset.units)
for(unitToRemove in ruleset.modOptions.unitsToRemove) units.remove(unitToRemove)
mods += ruleset.mods
}
fun clear() {

View File

@ -64,7 +64,9 @@ class MapEditorScreen(): CameraStageBaseScreen() {
gameSetupInfo.gameParameters = scenario.gameParameters
ruleset = RulesetCache.getComplexRuleset(scenario.gameParameters)
// Since the ruleset is referenced directly from other places, we can't just replace it directly
ruleset.clear()
ruleset.add(RulesetCache.getComplexRuleset(scenario.gameParameters))
initialize()
}