beyond-all-reason / beyond-all-reason/RecoilEngine
Set*MoveTypeData: Do not throw errors when unitID does not have the specified movetype
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
For `Set{Gunship,Air,Ground}MoveTypeData` defined [here](https://github.com/beyond-all-reason/spring/blob/3557f96852b6bd4a6fbaab7808fec9bb144d488e/rts/Lua/LuaSyncedMoveCtrl.cpp#L578-L591).
Receiving a unitID that does not have the movetype to be set (`ParseDerivedMoveType` output is nullptr), instead of throwing an error, should log it and return 0 (same as current behavior without throwing the error).
Receiving an invalid input is not an exception, rather an expected case to be dealt with.
Contributor guide
Research direction
Start in rts/Lua/LuaSyncedMoveCtrl.cpp around Set{Gunship,Air,Ground}MoveTypeData and trace the ParseDerivedMoveType result. Check how the functions handle a nullptr when the unit lacks the requested movetype. Done means invalid movetype input is logged, returns 0, and no error is thrown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100