-
Notifications
You must be signed in to change notification settings - Fork 481
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
Add function to remove unit from squad #5256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you expose this function to Lua (in LuaAPI.cpp
) and add documentation in Lua API.rst
?
Also, needs changelog under the API and Lua (after being exposed to Lua) sections
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- should I remove the "draft" PR status?
Sure, thank you! Do you think that the function should return a value? If it returns false at any point after changing game state it would likely be a bug that leaves game state inconsistent, so maybe I should just have it be void and expect that it works fine? |
That's a good point. I think that it should return false if the unit is not in a squad or other preconditions fail. I think it should return true if it has updated all the state that is feasible to update. If some dependent data structure cannot be found, I think it can skip it and still return true. |
Originally intended to be used in a now-cancelled Lua script feature, but figured it may be useful for those dabbling in military matters.