From 775f4cb7c15ee23cc171b1a15283f941084b845a Mon Sep 17 00:00:00 2001 From: Luke H-W Date: Thu, 5 May 2022 22:53:48 +0930 Subject: [PATCH] GiveCommand: fix edge case with unspaced multiple args (#539) Co-authored-by: AnimeGitB --- src/main/java/emu/grasscutter/command/commands/GiveCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/command/commands/GiveCommand.java b/src/main/java/emu/grasscutter/command/commands/GiveCommand.java index c2039dece..f3f2adc17 100644 --- a/src/main/java/emu/grasscutter/command/commands/GiveCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GiveCommand.java @@ -20,7 +20,7 @@ import java.util.regex.Matcher; public final class GiveCommand implements CommandHandler { Pattern lvlRegex = Pattern.compile("l(?:vl?)?(\\d+)"); // Java is a joke of a proglang that doesn't have raw string literals Pattern refineRegex = Pattern.compile("r(\\d+)"); - Pattern amountRegex = Pattern.compile("((?<=x)\\d+|\\d+(?=x))"); + Pattern amountRegex = Pattern.compile("((?<=x)\\d+|\\d+(?=x)(?!x\\d))"); private int matchIntOrNeg(Pattern pattern, String arg) { Matcher match = pattern.matcher(arg);