Skip to content

Commit

Permalink
Fixed duplicating paintjobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
wispborne committed Feb 14, 2024
1 parent 24d8def commit e6f5830
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOGS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 1.3.11

**MagicPaintjobs**
- Fixed paintjobs duplicating in the selector every save load (reported by Galaga Galaxian).

Version 1.3.10

**MagicBounty**
Expand Down
Binary file modified jars/MagicLib.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion magiclib.version
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
{
"major": "1",
"minor": "3",
"patch": "10"
"patch": "11"
}
}
2 changes: 1 addition & 1 deletion mod_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Modding Community: Dark.Revenant, LazyWizard, Nicke, Originem, Rubi, Schaf-Unschaf, Snrasha, Tartiflette, Wisp, Wyvern...",
"utility": "true",
# Using the long version format lets the game correctly compare major/minor/patch versions.
"version": { "major": '1', "minor": '3', "patch": '10' },
"version": { "major": '1', "minor": '3', "patch": '11' },
"description": "A collection of classes to aid modding. Not a mod in itself, but required by other mods.",
"gameVersion": "0.97a-RC6",
"dependencies": [
Expand Down
16 changes: 7 additions & 9 deletions src/org/magiclib/paintjobs/MagicPaintjobManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ object MagicPaintjobManager {
})
}

paintjobsInner.clear()
paintjobsInner.addAll(loadPaintjobs().values)
}

Expand Down Expand Up @@ -157,21 +158,18 @@ object MagicPaintjobManager {
// Just a blank row, no need to warn.
// logger.warn("Paintjob #$i in ${mod.id} by '${mod.author}' has no id, skipping.")
skip = true
}
if (hullIds.isEmpty()) {
} else if (hullIds.isEmpty()) {
logger.warn("Paintjob $id in ${mod.id} by '${mod.author}' has no hullIds, skipping.")
skip = true
}
if (name.isBlank()) {
} else if (name.isBlank()) {
logger.warn("Paintjob $id in ${mod.id} by '${mod.author}' has no name, skipping.")
skip = true
}
if (spriteId.isBlank()) {
} else if (spriteId.isBlank()) {
logger.warn("Paintjob $id in ${mod.id} by '${mod.author}' has no spriteId, skipping.")
skip = true
}
if (hullIds.none {
kotlin.runCatching { Global.getSettings().getHullSpec(it) }.getOrNull() != null
} else if (hullIds.none {
kotlin.runCatching { Global.getSettings().getHullSpec(it) }
.getOrNull() != null
}) {
logger.warn("Paintjob $id in ${mod.id} by '${mod.author}' has no valid hullIds, skipping.")
skip = true
Expand Down

0 comments on commit e6f5830

Please sign in to comment.