[DDA Port] Map reference migration part 1 #1732
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 "[DDA Port] Port code to use global getters instead of g->u and g->m"
Purpose of change
Reducing dependency on
game.h
andgame
class.Describe the solution
This and following PRs are cherry-picks of corresponding DDA PRs.
This one is CleverRaven/Cataclysm-DDA#41358
The idea is to use
get_map()
,get_avatar()
andget_player_character()
instead of includinggame.h
just forg->m
org->u
.Cherry-picks are done somewhat loosely (parts of commits are dropped, parts are adapted for BN) since the divergence is quite noticeable at this point, so some usages of
g->u
org->m
may remain in the changed files.Describe alternatives you've considered
Doing this manually, but that would produce even more merge conflicts down the line.
Testing
Compiles locally. No behavior changes intended.
Additional context
These are bound to cause merge conflicts with other open PRs, so in case they're interfering I'm fine with these being put off in favor of other changes.