-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 more body_part to bodypart_id #40138
Conversation
IDK if it's a false negative, but this is triggering an issue in the behavior test. |
I also got an immediate crash on loading a game, so I'm going with that being a real problem :D |
src/character.cpp
Outdated
temp_equalizer( bodypart_id( "torso" ), bodypart_id( "leg_r" ) ); | ||
temp_equalizer( bodypart_id( "torso" ), bodypart_id( "head" ) ); | ||
} | ||
if( bp == bodypart_id( "head" ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a little ugly, but this should probably be a series of else if
statements for a mild improvement in performance.
I'm not sure if it's worth predeclaring the bodypart_ids as consts.
Ideally, all this would go away and be replaced by lists of bodypart_ids to be equalized attached to each bodypart_id, but that's obviously beyond the scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternate intermediate solution would be to have e.g. a hardcoded unordered_map<bodypart_id, vector<bodypart_id>>
. That might lead to cleaner code, but I don't think it matters that much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Straightforward search and replace refactor with hopefully no semantic changes.
Plus post-cherrypick fixes
Summary
SUMMARY: Infrastructure "Move more body_part to bodypart_id in temperature related functions"
Purpose of change
Part of #39068
Describe the solution
Describe alternatives you've considered
Testing
Compile without error
Additional context