Move can_reload and rate_action_* functions #41097
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "Moved can_reload and rate_action_* functions"
Purpose of change
Chipping away at
player
class as part of deprecating it (see #34721)Collecting all rate_action_* functions in 2 spots
Describe the solution
Moved the majority of
rate_action_*
functions fromplayer
/avatar
/Character
intogame.cpp
and made them static - since that was the only place where they were used.These functions required small modifications in the name of bug fixing / code organization:
rate_action_change_side
rate_action_disassemble
rate_action_wear
rate_action_takeoff
These functions are used in loading/unloading code and had to be moved, unchanged, into
Character
class:rate_action_unload
rate_action_reload
- requiredcan_reload
to be moved as wellDescribe alternatives you've considered
Splitting these functions between
avatar
andCharacter
, but I figured that functions that are used only in item examination screen should stay near that item examination screen.Testing
For various items, opened item examination menu and tried listed actions.
Assembled an ammo belt from linkages & rounds.
Disassembled a TV.