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
1 changed files with 5 additions and 8 deletions

View File

@ -42,15 +42,12 @@ 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;
}
}