Skip to content

Commit 093b76d

Browse files
committed
Fix Autofly
1 parent 2527378 commit 093b76d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/main/java/net/wurstclient/command/CmdProcessor.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ private boolean runHackShortcut(String input)
108108
String[] args = input.trim().split("\\s+");
109109
if(args.length == 0 || args[0].isEmpty())
110110
return false;
111+
112+
// If a real command shares this name, let the command parser handle it.
113+
// This keeps legacy commands like .autofly working even when the hack
114+
// name is also runnable as a shortcut.
115+
if(cmds.getCmdByName(args[0]) != null)
116+
return false;
111117

112118
Hack hack = WurstClient.INSTANCE.getHax().getHackByName(args[0]);
113119
if(hack == null)
@@ -140,10 +146,6 @@ private boolean runHackShortcut(String input)
140146
}
141147
}
142148

143-
// Let same-name commands continue to support their own extra arguments.
144-
if(cmds.getCmdByName(args[0]) != null)
145-
return false;
146-
147149
ChatUtils
148150
.error("Syntax: " + getPrefix() + args[0] + " [on|off|toggle]");
149151
return true;

0 commit comments

Comments
 (0)