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

Let the Spring.GiveOrder callout family accept nil params/opts #1821

Open
sprunk opened this issue Dec 16, 2024 · 0 comments · May be fixed by #1822
Open

Let the Spring.GiveOrder callout family accept nil params/opts #1821

sprunk opened this issue Dec 16, 2024 · 0 comments · May be fixed by #1822
Labels
enhancement New feature or request Lua API

Comments

@sprunk
Copy link
Collaborator

sprunk commented Dec 16, 2024

  • Spring.GiveOrder(cmdID, {}, 0) is required to correctly give a parameterless option.
  • you cannot skip either the params or the opts args.
  • you can pass a fake numerical parameter arg to avoid making a table, e.g. spGiveOrder(cmdID, 0, 0), but this is only correct if a command is strictly parameterless (will have a behaviour difference if it can accept either 0 or 1 arg).
  • the request is to let opts accept nil and default to 0, and for params to also accept nil and default to no params. This would let devs give commands like spGiveOrder(CMD.STOP).
  • don't forget to document it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Lua API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant