From a8b11b4bdd6f6d2f4c0e06c1a8e29804f23e1e99 Mon Sep 17 00:00:00 2001 From: Kamayana Date: Wed, 13 Dec 2023 22:38:58 -0600 Subject: [PATCH] Invalidate non-adjacent containers for ALL and DRAGGED (#70172) This also changes it to not update the container_base_loc's position for ALL and DRAGGED, which made it so pressing X would exit out to a 1-9 location instead of ALL or DRAGGED Co-authored-by: andrei <68240139+andrei8l@users.noreply.github.com> --- src/advanced_inv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/advanced_inv.cpp b/src/advanced_inv.cpp index dc3c4154a81cb..f0b417eb5a025 100644 --- a/src/advanced_inv.cpp +++ b/src/advanced_inv.cpp @@ -707,7 +707,7 @@ void advanced_inventory::recalc_pane( side p ) advanced_inv_area &other = squares[there.get_area()]; avatar &player_character = get_avatar(); if( pane.container && - pane.container_base_loc >= AIM_SOUTHWEST && pane.container_base_loc <= AIM_NORTHEAST ) { + pane.container_base_loc >= AIM_SOUTHWEST && pane.container_base_loc <= AIM_ALL ) { const tripoint_rel_ms offset = player_character.pos_bub() - pane.container.pos_bub(); @@ -717,7 +717,7 @@ void advanced_inventory::recalc_pane( side p ) pane.container = item_location::nowhere; pane.container_base_loc = NUM_AIM_LOCATIONS; - } else { + } else if( pane.container_base_loc <= AIM_NORTHEAST ) { pane.container_base_loc = static_cast( ( offset.y() + 1 ) * 3 - offset.x() + 2 ); } }