소스 검색

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…
취소
저장