Browse Source

Commands have to be followed by a space

master
Chris Smith 15 years ago
parent
commit
741e6b733f
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/com/md87/charliebravo/InputHandler.java

+ 5
- 2
src/com/md87/charliebravo/InputHandler.java View File

216
 
216
 
217
             if (command == null) {
217
             if (command == null) {
218
                 for (Command pcommand : commands) {
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
                         command = pcommand;
223
                         command = pcommand;
222
                         index = pcommand.getClass().getSimpleName().length() - 6;
224
                         index = pcommand.getClass().getSimpleName().length() - 6;
225
+                        break;
223
                     }
226
                     }
224
                 }
227
                 }
225
             }
228
             }

Loading…
Cancel
Save