ositools icon indicating copy to clipboard operation
ositools copied to clipboard

Warn when invoking an unregistered console command

Open PinewoodPip opened this issue 2 years ago • 0 comments

This PR adjusts console commands to show a warning when invoking a command that hasn't been registered.

image

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.

PinewoodPip avatar Aug 30 '23 10:08 PinewoodPip