mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 11:57:35 +00:00
Clean up OpenStateData onLoad logic
This commit is contained in:
parent
4a675cc81d
commit
45c08c5826
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user