beyond-all-reason / beyond-all-reason/RecoilEngine

Set*MoveTypeData: Do not throw errors when unitID does not have the specified movetype

Open
#742 0 comments 0 reactions 0 assignees View on GitHub
good first issue
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.