Try to execute a command
| 345 | |
| 346 | // Try to execute a command |
| 347 | bool Console::execCmd(const char* cmd, const char* param) |
| 348 | { |
| 349 | if(!cmd) |
| 350 | return false; |
| 351 | |
| 352 | int HashIndex = cmd[0]; |
| 353 | HashIndex = tolower(HashIndex); |
| 354 | |
| 355 | ConsoleCommand* pcmd = mCmds[HashIndex]; |
| 356 | |
| 357 | while(pcmd) |
| 358 | { |
| 359 | if(Ps::stricmp(cmd, pcmd->fullcmd) == 0) |
| 360 | { |
| 361 | pcmd->function(this, param, mUserData); |
| 362 | return true; |
| 363 | } |
| 364 | else pcmd = pcmd->next; |
| 365 | } |
| 366 | return false; |
| 367 | } |
| 368 | |
| 369 | // Destroy the console |
| 370 | void Console::destroy() |