-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Unsorted Strip Zones don't work for a 1x1 #56478
Comments
Turns out it doesn't work because the check is expecting the distance between the player and the zone to be 0: Cataclysm-DDA/src/activity_item_handling.cpp Lines 2172 to 2176 in 3d0002b
There are 2 ways to fix this:
diff --git a/src/activity_item_handling.cpp b/src/activity_item_handling.cpp
index 8121b27393..0cef8c2fe1 100644
--- a/src/activity_item_handling.cpp
+++ b/src/activity_item_handling.cpp
@@ -2172,8 +2172,8 @@ void activity_on_turn_move_loot( player_activity &act, Character &you )
// 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() ) ) {
+ if( mgr.has_near( zone_type_zone_unload_all, abspos, 1 ) ||
+ ( mgr.has_near( zone_type_zone_strip, abspos, 1 ) && it->first->is_corpse() ) ) {
if( dest_set.empty() && !it->first->is_container_empty() && !it->first->any_pockets_sealed() ) {
for( item *contained : it->first->all_items_top( item_pocket::pocket_type::CONTAINER ) ) {
// no liquids don't want to spill stuff
diff --git a/src/activity_item_handling.cpp b/src/activity_item_handling.cpp
index 8121b27393..7a841bfc0c 100644
--- a/src/activity_item_handling.cpp
+++ b/src/activity_item_handling.cpp
@@ -2056,7 +2056,8 @@ void activity_on_turn_move_loot( player_activity &act, Character &you )
// adjacent to the loot source tile
if( !is_adjacent_or_closer ) {
std::vector<tripoint> route;
- bool adjacent = false;
+ // strip corpses zones require the player to actually be in the zone
+ bool adjacent = mgr.has( zone_type_zone_strip, src );
// get either direct route or route to nearest adjacent tile if
// source tile is impassable Just putting the solutions out for you to decide, since I don't know which is better :P |
you make it look easy LOL |
I'd vote 1, you wanna PR it for the cred, I can if you're too lazy. |
Describe the bug
Unsorted Strip Zones don't work for a 1x1 with corpses in them and the player standing off to the side.
Steps to reproduce
kill a zombie
put a 1x1 unsorted zone under them
put a 1x1 strip zone under them
stand off to the side (standing on top doesn't replicate this)
hit sort
nothing will happen
Expected behavior
Really weird oddity, seems to not happen with personal zones and seems to happen only if off to the side. My guess is it's fast exiting because of some logic but I haven't looked closely.
Screenshots
No response
Versions and configuration
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
No Fungal Growth [no_fungal_growth],
Bionic Professions [package_bionic_professions]
]
Additional context
My dirty version is irrelevant, this was reported on the discord by @TheMurderUnicorn I'm just chronicling it to fix later.
The text was updated successfully, but these errors were encountered: