Complex ruleset merge order (#2240)

* .gitignore: mods SaveFiles transients

* Simple transposition prevents mod improvements from appearing below roads&removals
should also move modded nations to the top in new game player picker
This commit is contained in:
proteus-anguinus 2020-03-25 11:52:20 +01:00 committed by GitHub
parent 06af3917ce
commit c40dd09e11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 8 deletions

11
.gitignore vendored
View file

@ -101,13 +101,6 @@ nb-configuration.xml
/local.properties
.gradle/
gradle-app.setting
/build/
/android/build/
/core/build/
/desktop/build/
/html/build/
/ios/build/
/ios-moe/build/
## OS Specific
.DS_Store
@ -139,3 +132,7 @@ desktop/packr/
desktop/packrCache/
deploy/
android/release/
android/assets/mods/
android/assets/SaveFiles/
android/assets/GameSettingsOld.json

View file

@ -171,12 +171,12 @@ object RulesetCache :HashMap<String,Ruleset>(){
fun getComplexRuleset(mods:Collection<String>): Ruleset {
val newRuleset = Ruleset()
newRuleset.add(getBaseRuleset())
for(mod in mods)
if(containsKey(mod)) {
newRuleset.add(this[mod]!!)
newRuleset.mods+=mod
}
newRuleset.add(getBaseRuleset())
return newRuleset
}
}