| 49 | } |
| 50 | |
| 51 | int CheckCommand(string name, int args) { |
| 52 | // find command id, return -1 if wrong. |
| 53 | for (int i = 0; i < ARRAYSIZE(commands); i++) { |
| 54 | if (name == commands[i].name) { |
| 55 | if (commands[i].minArgs > args) { |
| 56 | printf("%s: Incorrect arguments count (at least %d needed)\n", commands[i].name, commands[i].minArgs); |
| 57 | return -1; |
| 58 | } |
| 59 | else |
| 60 | return commands[i].id; |
| 61 | } |
| 62 | } |
| 63 | return -2; |
| 64 | } |
| 65 | |
| 66 | void Update() { |
| 67 | if (have_high) |