From 45c08c5826d0adfc66a0258256f080fa30f4facb Mon Sep 17 00:00:00 2001 From: Melledy <52122272+Melledy@users.noreply.github.com> Date: Wed, 31 Aug 2022 03:38:37 -0700 Subject: [PATCH] Clean up OpenStateData onLoad logic --- .../emu/grasscutter/data/excels/OpenStateData.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/emu/grasscutter/data/excels/OpenStateData.java b/src/main/java/emu/grasscutter/data/excels/OpenStateData.java index 1bb0803ef..ee00c621a 100644 --- a/src/main/java/emu/grasscutter/data/excels/OpenStateData.java +++ b/src/main/java/emu/grasscutter/data/excels/OpenStateData.java @@ -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 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; } }