Clean up OpenStateData onLoad logic

This commit is contained in:
Melledy 2022-08-31 03:38:37 -07:00
parent 4a675cc81d
commit 45c08c5826
No known key found for this signature in database
GPG Key ID: 2A8E7A1D64737CCB

View File

@ -42,16 +42,13 @@ public class OpenStateData extends GameResource {
// Add this open state to the global list.
GameData.getOpenStateList().add(this);
// Clean up cond.
List<OpenStateCond> cleanedConds = new ArrayList<>();
for (var c : this.cond) {
if (c.getCondType() != null) {
cleanedConds.add(c);
// Remove any empty conditions
if (this.cond != null) {
this.cond.removeIf(c -> c.getCondType() == null);
} else {
this.cond = new ArrayList<>();
}
}
this.cond = cleanedConds;
}
}
/* Open state names for documentation: