diff --git a/core/src/mindustry/core/ContentLoader.java b/core/src/mindustry/core/ContentLoader.java index 7abaf35f29..1e2afa02de 100644 --- a/core/src/mindustry/core/ContentLoader.java +++ b/core/src/mindustry/core/ContentLoader.java @@ -171,6 +171,13 @@ public class ContentLoader{ public void handleMappableContent(MappableContent content){ if(contentNameMap[content.getContentType().ordinal()].containsKey(content.name)){ + var list = contentMap[content.getContentType().ordinal()]; + + //this method is only called when registering content, and after handleContent. + //If this is the last registered content, and it is invalid, make sure to remove it from the list to prevent invalid stuff from being registered + if(list.size > 0 && list.peek() == content){ + list.pop(); + } throw new IllegalArgumentException("Two content objects cannot have the same name! (issue: '" + content.name + "')"); } if(currentMod != null){ diff --git a/core/src/mindustry/ctype/UnlockableContent.java b/core/src/mindustry/ctype/UnlockableContent.java index 2692c28a94..c8eacc4f6a 100644 --- a/core/src/mindustry/ctype/UnlockableContent.java +++ b/core/src/mindustry/ctype/UnlockableContent.java @@ -64,7 +64,7 @@ public abstract class UnlockableContent extends MappableContent{ @Override public void loadIcon(){ fullIcon = - Core.atlas.find(fullOverride, + Core.atlas.find(fullOverride == null ? "" : fullOverride, Core.atlas.find(getContentType().name() + "-" + name + "-full", Core.atlas.find(name + "-full", Core.atlas.find(name,