Skip to content

Conversation

RenechCDDA
Copy link
Member

Summary

None

Purpose of change

image

These two functions are(were, prior to this PR) named the same, but do very different things! The former includes heat modifications from sources such as fires or heaters.

This caused one mistake in the past, where these two functions checked entirely different things ( Context #82812 ):

The first function allowed one to 'cheat' by building fires before planting.
image

Describe the solution

Rename one of the functions and add some explanatory comments.

No functional changes.

Describe alternatives you've considered

  1. Also renaming the untouched get_temperature() to get_local_temperature() or similar, to make it very explicit.

  2. While making this PR I had to get through all existing uses of get_temperature() in the code (33 cases including tests).

There are some which are quite iffy if they should be using local temperature with convective/radiative modifications. But I did not change any in this PR. Maybe it's worth specifically looking at them.

Testing

If it builds it should be good to go.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Weather Rain, snow, portal storms and non-temperature environment json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Sep 17, 2025
@PatrikLundell
Copy link
Contributor

I went through the usages of get_temperature() and the only iffy case was the differences between the warm_enough_to_plant() operations, which may have been addressed (I'm delaying updating my master until #82821 us merged or I have to in order to fix something for my game play purposes). I believe it at least has been discussed in some PR.

There are a number of places where you might want to set temperature with hysteresis from a parent object (if one exists) rather than the abient one, but that would be improvements in functionality, as the temperature used for the target is the correct one, which is the purpose of this PR.
It's possible some of these may be behind cases of instant (well, the next temperature check) rot when removing items from cold environments, but, again, it's not within the scope of this PR.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 17, 2025
@GuardianDll GuardianDll merged commit d1be24f into CleverRaven:master Sep 19, 2025
29 of 30 checks passed
@RenechCDDA RenechCDDA deleted the temperature_function_name_change branch September 19, 2025 12:03
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 Mechanics: Weather Rain, snow, portal storms and non-temperature environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants