diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 416362c16fa..a4eec6dc868 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1232,10 +1232,10 @@ B --><-- A return L -/atom/proc/contains(var/atom/location) - if(!location) - return 0 - if(location == src) - return 1 - return contains(location.loc) +/atom/proc/contains(var/atom/A) + if(!A) + return 0 + for(var/atom/location = A.loc, location, location = location.loc); // Semicolon is for the empty statement. + if(location == src) + return 1 \ No newline at end of file diff --git a/code/modules/tgui/states/deep_inventory.dm b/code/modules/tgui/states/deep_inventory.dm index e250a80d51a..70f2a59992e 100644 --- a/code/modules/tgui/states/deep_inventory.dm +++ b/code/modules/tgui/states/deep_inventory.dm @@ -1,7 +1,7 @@ /** * tgui state: deep_inventory_state * - * Checks that the src_object is in the user's fist-level (backpack, webbing, etc) inventory. + * Checks that the src_object is in the user's deep (backpack, box, toolbox, etc) inventory. **/ /var/global/datum/ui_state/deep_inventory_state/deep_inventory_state = new() diff --git a/code/modules/tgui/states/notcontained.dm b/code/modules/tgui/states/notcontained.dm index 109bbd16932..0b6462fe331 100644 --- a/code/modules/tgui/states/notcontained.dm +++ b/code/modules/tgui/states/notcontained.dm @@ -15,7 +15,7 @@ return UI_CLOSE /mob/living/notcontained_can_use_topic(atom/src_object) - if(src in src_object.contents) + if(src_object.contains(src)) return UI_CLOSE // Close if we're inside it. return default_can_use_topic(src_object)