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

Move can_reload and rate_action_* functions #41097

Merged
merged 12 commits into from
Jun 7, 2020
Merged

Move can_reload and rate_action_* functions #41097

merged 12 commits into from
Jun 7, 2020

Conversation

olanti-p
Copy link
Contributor

@olanti-p olanti-p commented Jun 5, 2020

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 from player/avatar/Character into game.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 - required can_reload to be moved as well

Describe alternatives you've considered

Splitting these functions between avatar and Character, 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.

@anothersimulacrum anothersimulacrum added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Jun 5, 2020
@kevingranade
Copy link
Member

Just as future direction, we really don't want game.cpp getting any bigger either, this ui element should move to its own module.

@kevingranade kevingranade merged commit 7ef381c into CleverRaven:master Jun 7, 2020
@olanti-p olanti-p deleted the migrate_rate_actions branch June 7, 2020 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants