Fix invalid item placement error #39497
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: None
Purpose of change
To fix a common CI test failure.
Describe the solution
Sometimes items from smashed car pieces are placed outside of the map bounds during mapgen. There doesn't seem to be a reasonable way to prevent this, so just suppress the error message in the cases it is expected to occur (the item position was already being clamped to the valid bounds).
Describe alternatives you've considered
The "proper" solution here would (I think) be to have a global cache of items that were intended to be placed in locations not currently loaded, and then when those submaps are next loaded the items would be placed on them. But that's a lot of infrastructure to fix a situation that rarely occurs in practice (it's only hitting the tests so much because of the unusual way in which one particular test does its mapgen).
Testing
Verified that the error no longer appears for a seed which was previously reliably causing a test failure.