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

fix wrong temp-delta conversion for windchill message #79274

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

marilynias
Copy link
Contributor

Summary

None

Purpose of change

While working on another PR I've found a wrong unit conversion, leadin to a message to virtually never show.
Full old section

if( conv_temp <= BODYTEMP_COLD && windchill < units::from_fahrenheit_delta( -10 ) &&
            one_in( 200 ) ) {
    add_msg( m_bad, _( "The wind is making your %s feel quite cold." ),
             body_part_name( bp ) );
} else if( conv_temp <= BODYTEMP_COLD && windchill < units::from_fahrenheit_delta( -20 ) &&
           one_in( 100 ) ) {
    add_msg( m_bad,
             _( "The wind is very strong; you should find some more wind-resistant clothing for your %s." ),
             body_part_name( bp ) );
} else if( conv_temp <= BODYTEMP_COLD && windchill < units::from_kelvin_delta( -30 ) &&
           one_in( 50 ) ) {
    add_msg( m_bad, _( "Your clothing is not providing enough protection from the wind for your %s!" ),
             body_part_name( bp ) );
}

Describe the solution

use units::from_fahrenheit_delta( -30 ) instead of units::from_kelvin_delta( -30 )

Describe alternatives you've considered

Testing

Message shows with enough wind.

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jan 21, 2025
@GuardianDll GuardianDll merged commit e22281c into CleverRaven:master Jan 22, 2025
26 of 29 checks passed
@marilynias marilynias deleted the from_kelvin_delta branch January 23, 2025 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants