Permalink
Browse files

Fixed issue where player-created aliases can't be used by the player.

  • Loading branch information...
sk89q committed Nov 21, 2010
1 parent 8c46c65 commit 7541ed7b473c3dcc5da9f3e7b609a7f992426d4b
Showing with 10 additions and 12 deletions.
  1. +10 −12 src/CommandHelperListener.java
@@ -260,21 +260,19 @@ private boolean runCommand(Player player, String[] split) throws InsufficientArg
} else {
session.setLastCommand(joinString(split, " "));
- if (player.canUseCommand(split[0])) {
- String[] commands = getSession(player).findAlias(split[0]);
- String[] arguments = new String[split.length - 1];
- System.arraycopy(split, 1, arguments, 0, split.length - 1);
+ String[] commands = getSession(player).findAlias(split[0]);
+ String[] arguments = new String[split.length - 1];
+ System.arraycopy(split, 1, arguments, 0, split.length - 1);
+
+ if (commands != null) {
+ execCommands(player, commands, arguments, false);
+ return true;
+ } else if (player.canUseCommand(split[0])) {
+ commands = findGlobalAlias(split[0]);
if (commands != null) {
- execCommands(player, commands, arguments, false);
+ execCommands(player, commands, arguments, true);
return true;
- } else {
- commands = findGlobalAlias(split[0]);
-
- if (commands != null) {
- execCommands(player, commands, arguments, true);
- return true;
- }
}
}
}

0 comments on commit 7541ed7

Please sign in to comment.