From 362958c0f1a5b7ef756cafb64707611fbac507f3 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 18 Aug 2024 15:47:22 -0400 Subject: [PATCH] More powerAction work. --- src/engine/wpak/PowersParser.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/wpak/PowersParser.java b/src/engine/wpak/PowersParser.java index f7cb82b6..91a33edf 100644 --- a/src/engine/wpak/PowersParser.java +++ b/src/engine/wpak/PowersParser.java @@ -19,6 +19,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -52,12 +53,12 @@ public class PowersParser { try { - String[] powerEntries = powerData.trim().split("\n"); + String[] lineData = powerData.trim().split("\n"); ArrayList powerHeader = new ArrayList<>(); // Parse header - String headerString = powerEntries[0]; + String headerString = lineData[0]; headerString = headerString.replace("\n", " "); Matcher matcher = STRSPLIT_REGEX.matcher(headerString); @@ -109,6 +110,9 @@ public class PowersParser { // Process key value pairs after header + iterator = Arrays.stream(lineData).iterator(); + iterator.next(); // Ignore header + while (iterator.hasNext()) { String lineValue = iterator.next();