Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when invoking an unregistered console command #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PinewoodPip
Copy link
Contributor

@PinewoodPip PinewoodPip commented Aug 30, 2023

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.

Also adjusted loop to use ipairs and _ for unused i variable, removing an unused variable IDE warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant