Fix item temperature processing in ice labs #39813
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: Bugfixes "Fix temperature processing in ice labs"
Purpose of change
Fixes #39778
Describe the solution
Rottable items on floor are processed on map load by
map::remove_rotten_items
. This processing used wrong coordinate. The temperature code didn't like that coordinate and would just always return 0 as the temperature modifier.Describe alternatives you've considered
Testing
Skipping time in ice lab, coming from far to ice lab after skipping time and going down stairs to ice lab after skipping time work with z-levels on and off.
Additional context
There is still a smaller bug: When z-levels are off
g->m.get_temperature( pos )
gives the temperature of wrong z-level for items processed bymap::remove_rotten_items
if the player changes z-level on that turn (with stairs, does not happen with debug teleport).So when you go from above ground (level 0, temperature modifier -20) to underground (level -1, temperature modifier -50) the items on the below ground floor get their temperatures processed with temperature modifier -20 instead of -50.