瀏覽代碼

Commands have to be followed by a space

master
Chris Smith 15 年之前
父節點
當前提交
741e6b733f
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5
    2
      src/com/md87/charliebravo/InputHandler.java

+ 5
- 2
src/com/md87/charliebravo/InputHandler.java 查看文件

@@ -216,10 +216,13 @@ public class InputHandler implements IChannelMessage, IPrivateMessage, IPrivateC
216 216
 
217 217
             if (command == null) {
218 218
                 for (Command pcommand : commands) {
219
-                    if (text.toLowerCase().startsWith(pcommand.getClass()
220
-                            .getSimpleName().replace("Command", "").toLowerCase())) {
219
+                    if (text.equalsIgnoreCase(pcommand.getClass()
220
+                            .getSimpleName().replace("Command", "")) ||
221
+                            text.toLowerCase().startsWith(pcommand.getClass()
222
+                            .getSimpleName().replace("Command", "").toLowerCase() + " ")) {
221 223
                         command = pcommand;
222 224
                         index = pcommand.getClass().getSimpleName().length() - 6;
225
+                        break;
223 226
                     }
224 227
                 }
225 228
             }

Loading…
取消
儲存