Merge pull request #15618 from TDSSS/ssu-nodrop-fix

SSU now reject nodrop items
This commit is contained in:
Fox McCloud
2021-07-13 00:36:13 -04:00
committed by GitHub
+30 -14
View File
@@ -331,26 +331,42 @@
if(default_deconstruction_screwdriver(user, "panel", "close", I))
I.play_tool_sound(user, I.tool_volume)
/**
* Tries to store the item into whatever slot it can go, returns true if the item is stored successfully.
*
**/
/obj/machinery/suit_storage_unit/proc/store_item(obj/item/I, mob/user)
. = FALSE
if(istype(I, /obj/item/clothing/suit) && !suit)
suit = I
. = TRUE
if(try_store_item(I, user))
suit = I
return TRUE
if(istype(I, /obj/item/clothing/head) && !helmet)
helmet = I
. = TRUE
if(try_store_item(I, user))
helmet = I
return TRUE
if(istype(I, /obj/item/clothing/mask) && !mask)
mask = I
. = TRUE
if(try_store_item(I, user))
mask = I
return TRUE
if(istype(I, /obj/item/clothing/shoes) && !boots)
boots = I
. = TRUE
if((istype(I, /obj/item/tank) || I.w_class <= WEIGHT_CLASS_SMALL) && !storage && !.)
storage = I
. = TRUE
if(.)
user.drop_item()
if(try_store_item(I, user))
boots = I
return TRUE
if((istype(I, /obj/item/tank) || I.w_class <= WEIGHT_CLASS_SMALL) && !storage)
if(try_store_item(I, user))
storage = I
return TRUE
return FALSE
/**
* Tries to store the item, returns true if it's moved successfully, false otherwise (because of nodrop etc)
*
**/
/obj/machinery/suit_storage_unit/proc/try_store_item(obj/item/I, mob/user)
if(user.drop_item())
I.forceMove(src)
return TRUE
return FALSE
/obj/machinery/suit_storage_unit/power_change()