From 9480d20308f542ba645b49bd740c1e3f8c8678f4 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Sun, 11 Nov 2018 11:47:14 +0100 Subject: [PATCH 1/3] Can now put stuf back in + text fix --- code/game/machinery/suit_storage_unit.dm | 34 +++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 3cabbac3e75..7b6488d83cc 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -159,12 +159,44 @@ /obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob, params) if(!is_operational()) + if(panel_open) + to_chat(usr, "Close the maintenance panel first.") + else + to_chat(usr, "The unit is not operational.") return if(isscrewdriver(I)) panel_open = !panel_open playsound(loc, I.usesound, 100, 1) to_chat(user, text("You [panel_open ? "open up" : "close"] the unit's maintenance panel.")) updateUsrDialog() + return + if(state_open) + if(store_item(I, user)) + src.update_icon() + src.updateUsrDialog() + to_chat(user, "You load the [I.name] into the storage compartment.") + else + to_chat(user, "The unit already contains that item.") + + +/obj/machinery/suit_storage_unit/proc/store_item(obj/item/I, mob/user) + . = FALSE + if(istype(I, /obj/item/clothing/suit/space) && !suit) + suit = I + . = TRUE + if(istype(I, /obj/item/clothing/head/helmet) && !helmet) + helmet = I + . = TRUE + if(istype(I, /obj/item/clothing/mask) && !mask) + mask = I + . = TRUE + if((istype(I, /obj/item/tank) || istype(I, /obj/item/clothing/shoes/magboots)) && !storage) + storage = I + . = TRUE + if(.) + user.drop_item() + I.forceMove(src) + /obj/machinery/suit_storage_unit/power_change() ..() @@ -380,7 +412,7 @@ dat+= text("Breathmask storage compartment: []
",(mask ? mask.name : "No breathmask detected.") ) if(mask && state_open) dat+="Dispense mask
" - dat+= text("Breathmask storage compartment: []
",(storage ? storage.name : "
No storage item detected.") ) + dat+= text("Jetpack, Magboots storage compartment: []
",(storage ? storage.name : "
No storage item detected.") ) if(storage && state_open) dat+="Dispense storage item
" if(occupant) From 5a8a8fb41265b5c808d71717449baa366635a900 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Sun, 11 Nov 2018 11:48:46 +0100 Subject: [PATCH 2/3] TANK NOT JETPACK --- code/game/machinery/suit_storage_unit.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 7b6488d83cc..8faf5007688 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -412,7 +412,7 @@ dat+= text("Breathmask storage compartment: []
",(mask ? mask.name : "
No breathmask detected.") ) if(mask && state_open) dat+="Dispense mask
" - dat+= text("Jetpack, Magboots storage compartment: []
",(storage ? storage.name : "
No storage item detected.") ) + dat+= text("Tank, Magboots storage compartment: []
",(storage ? storage.name : "
No storage item detected.") ) if(storage && state_open) dat+="Dispense storage item
" if(occupant) From 89d1832556abe16a59408595f67597ab25af0d34 Mon Sep 17 00:00:00 2001 From: farie82 Date: Sun, 11 Nov 2018 12:21:32 +0100 Subject: [PATCH 3/3] Ty's comments --- code/game/machinery/suit_storage_unit.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 8faf5007688..f7fed41581d 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -172,9 +172,9 @@ return if(state_open) if(store_item(I, user)) - src.update_icon() - src.updateUsrDialog() - to_chat(user, "You load the [I.name] into the storage compartment.") + update_icon() + updateUsrDialog() + to_chat(user, "You load the [I] into the storage compartment.") else to_chat(user, "The unit already contains that item.")