fixed item location load failure fallback #75441
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
None
Purpose of change
Fix #75439, i.e. item_location target loss recovery leading to crash.
Describe the solution
Replace fallback's usage of an extreme position ( tripoint_min) for the place where an item is placed to use the location at which the parent that couldn't be located was placed (the item is supposed to drop to the ground). At a guess, this position is set to something reasonable for the other usages of the ptr.reset operation, but not in this fallback case.
Describe alternatives you've considered
Testing
The bug report's save doesn't crash anymore. However, I have no idea what the item that's supposed to drop is, and I don't find any items at (65, 69, 0) where the parent container was supposed to reside. Thus, I can't really verify it works as intended, only that it no longer crashes.
Additional context