Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unload zones when unload target is on the zone's edge #56483

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

dseguin
Copy link
Member

@dseguin dseguin commented Mar 30, 2022

Summary

None

Purpose of change

When using a strip zone or an unload-all zone, if the target unload item is on the edge of the zone, the player only performs the sort action if they're standing in the zone.

The unload check is expecting the distance between the player and the zone to be 0:

// if this item isn't going anywhere and its not sealed
// check if it is in a unload zone or a strip corpse zone
// then we should unload it and see what is inside
if( mgr.has_near( zone_type_zone_unload_all, abspos, 0 ) ||
( mgr.has_near( zone_type_zone_strip, abspos, 0 ) && it->first->is_corpse() ) ) {

Since the automovement puts the player directly beside the item to unload, this check will fail if the item is on the zone's edge.

Describe the solution

Increase the zone's range check to 1 (preferred solution by BombasticSlacks).

Describe alternatives you've considered

Make the automovement put the player directly on the zone (not adjacent) if the zone is one of the two above.

Testing

2022-03-30.17-58-54.mp4

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Mar 30, 2022
@bombasticSlacks
Copy link
Contributor

Reasoning for this solution is so it still works if the items are in a furniture you can't otherwise share a tile with.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Mar 31, 2022
@kevingranade kevingranade merged commit a006d14 into CleverRaven:master Apr 6, 2022
@dseguin dseguin deleted the fix_adjacent_sortzones branch April 6, 2022 01:08
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsorted Strip Zones don't work for a 1x1
3 participants