ositools
ositools copied to clipboard
Warn when invoking an unregistered console command
This PR adjusts console commands to show a warning when invoking a command that hasn't been registered.
This makes it easier/faster to realize whether you've made a typo in a command, forgot to load the script it's in, are trying to run it in the wrong context, or ran into other shenanigans that might cause it to not run.
The loop has also been adjusted to use ipairs(); the order of pairs() is unspecified for numeric keys, though it does seem to work orderly in most cases.
Additionally, the i variable in the loop has been replaced with _ to silence an "unused variable" warning in the Sumneko lua extension.