mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-23 11:13:21 +08:00
Clean up OpenStateData onLoad logic
This commit is contained in:
parent
4a675cc81d
commit
45c08c5826
@ -42,16 +42,13 @@ public class OpenStateData extends GameResource {
|
|||||||
// Add this open state to the global list.
|
// Add this open state to the global list.
|
||||||
GameData.getOpenStateList().add(this);
|
GameData.getOpenStateList().add(this);
|
||||||
|
|
||||||
// Clean up cond.
|
// Remove any empty conditions
|
||||||
List<OpenStateCond> cleanedConds = new ArrayList<>();
|
if (this.cond != null) {
|
||||||
for (var c : this.cond) {
|
this.cond.removeIf(c -> c.getCondType() == null);
|
||||||
if (c.getCondType() != null) {
|
} else {
|
||||||
cleanedConds.add(c);
|
this.cond = new ArrayList<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cond = cleanedConds;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open state names for documentation:
|
/* Open state names for documentation:
|
||||||
|
Loading…
Reference in New Issue
Block a user