mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-08 01:43:59 +07:00
Fixed crash related to uninitialized content
This commit is contained in:
parent
8cd8b2c6df
commit
9063fca2b5
@ -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){
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user