Fix map cache segfault, remove omt tripoints from map items' operations #79537
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
Bugfixes "fix map cache segfault, remove omt tripoints from map items' operations"
Purpose of change
Fix segfault on using a
map cache
itemDescribe the solution
#79307 didn't account for
location_variable_adjust
, which usestripoint_abs_ms
and nottripoint_abs_omt
, resulting in a tripoint type mismatch. When it was submitted, the maps I used just happened to work, I guess.I realized that EOCs pretty much exclusively use
tripoint_abs_ms
, so trying to include more point types into EOCs was probably a bad idea. SPAWN_LOCATION_OMT usingtripoint_abs_omt
was therefore the outlier, so I changed it to recordtripoint_abs_ms
and project to _omt forreveal_map
.There are still issues with map-related items initializing their locations, see #79536
Describe alternatives you've considered
Serializing tripoint type and/or generalizing EOC tripoint use, either of which are overkill for maps alone
Testing
Used both a map cache with and without an initialized location, used a road map, verified TCLF badges still display correctly
For existing saves: because the
item_var
fields' names were changed, existing unread maps/badges you still want to use can be reinitialized by dropping them near their original spawn location; using them without doing this will default to the player's position without errorAdditional context