mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-03-11 17:30:57 -07:00
Fixed improperly initialized mods crashing the database
This commit is contained in:
parent
03bea6b291
commit
42fe38c2aa
1 changed files with 8 additions and 4 deletions
|
|
@ -84,11 +84,15 @@ public class DatabaseDialog extends BaseDialog{
|
|||
for(var contents : allContent){
|
||||
for(var content : contents){
|
||||
if(content instanceof UnlockableContent u){
|
||||
var categoryContents = sortedContents.get(u.databaseCategory == null ? u.getContentType().name() : u.databaseCategory, new OrderedMap<>());
|
||||
var taggedContents = categoryContents.get(u.databaseTag == null ? "default" : u.databaseTag, new Seq<>());
|
||||
//some mods don't initialize these properly
|
||||
String cat = u.databaseCategory == null ? u.getContentType().name() : u.databaseCategory;
|
||||
String tag = u.databaseTag == null ? "default" : u.databaseTag;
|
||||
|
||||
var categoryContents = sortedContents.get(cat, new OrderedMap<>());
|
||||
var taggedContents = categoryContents.get(tag, new Seq<>());
|
||||
taggedContents.add(u);
|
||||
categoryContents.put(u.databaseTag, taggedContents);
|
||||
sortedContents.put(u.databaseCategory, categoryContents);
|
||||
categoryContents.put(tag, taggedContents);
|
||||
sortedContents.put(cat, categoryContents);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue