mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Fix contains proc to use a loop
This commit is contained in:
@@ -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
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user