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

Accept nil for params and options arguments for Spring.GiveOrder family functions. #1822

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

Conversation

saurtron
Copy link
Collaborator

@saurtron saurtron commented Dec 17, 2024

Work done

  • Make GiveOrder functions accept nil/none for params and options arguments.
  • Affected functions:
    • GiveOrderToUnit
    • GiveOrderToUnitMap
    • GiveOrderToUnitArray
    • GiveOrderArrayToUnit
    • GiveOrderArrayToUnitMap
    • GiveOrderArrayToUnitArray

Related issues

Remarks

  • This allows skipping the arguments altogether on the calls, like: Spring.GiveOrderToUnit(unitID, CMD.STOP)
  • Also allows setting an empty params without passing an empty table, previously it wasn't possible.
    • Spring.GiveOrderToUnit(unitID, CMD.SELFD, nil, {"shift"})
    • Ppl sometimes passing 0 there to avoid a table, but it's incorrect since it adds a param with value 0.

How to test

@saurtron saurtron force-pushed the lua-parse-command-nil-params-and-opts branch from 82fd7a9 to 8e180a7 Compare December 17, 2024 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let the Spring.GiveOrder callout family accept nil params/opts
2 participants