From 72380b2aadb27d56394be7dda59d5b755f34c478 Mon Sep 17 00:00:00 2001 From: Markolie Date: Fri, 14 Aug 2015 20:10:41 +0200 Subject: [PATCH] Update ID code in communications computer, make chem dispensers/chem masters accessible to ghosts --- code/game/machinery/computer/communications.dm | 6 ++++-- code/modules/reagents/Chemistry-Machinery.dm | 15 ++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index b7892c8170f..1b2e8b1e8fd 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -87,7 +87,8 @@ var/shuttle_call/shuttle_calls[0] if(href_list["login"]) var/mob/living/carbon/human/M = usr - var/obj/item/weapon/card/id/I = M.get_active_hand()||M.wear_id||M.wear_pda + var/obj/item/card = M.get_active_hand() + var/obj/item/weapon/card/id/I = (card && card.GetID())||M.wear_id||M.wear_pda if (istype(I, /obj/item/device/pda)) var/obj/item/device/pda/pda = I I = pda.id @@ -124,7 +125,8 @@ var/shuttle_call/shuttle_calls[0] return 1 tmp_alertlevel = text2num(href_list["level"]) var/mob/living/carbon/human/L = usr - var/obj/item/weapon/card/id/I = L.get_active_hand()||L.wear_id||L.wear_pda + var/obj/item/card = L.get_active_hand() + var/obj/item/weapon/card/id/I = (card && card.GetID())||L.wear_id||L.wear_pda if (istype(I, /obj/item/device/pda)) var/obj/item/device/pda/pda = I I = pda.id diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 08560c6011e..306faff71c0 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -155,8 +155,8 @@ ui.open() /obj/machinery/chem_dispenser/Topic(href, href_list) - if(stat & (NOPOWER|BROKEN)) - return 0 // don't update UIs attached to this object + if(..()) + return 1 if(href_list["amount"]) amount = round(text2num(href_list["amount"]), 5) // round to nearest 5 @@ -245,6 +245,9 @@ /obj/machinery/chem_dispenser/attack_ai(mob/user as mob) return src.attack_hand(user) + +/obj/machinery/chem_dispenser/attack_ghost(mob/user as mob) + return src.attack_hand(user) /obj/machinery/chem_dispenser/attack_hand(mob/user as mob) if(stat & BROKEN) @@ -444,9 +447,8 @@ return /obj/machinery/chem_master/Topic(href, href_list) - if(stat & (BROKEN|NOPOWER)) return - if(usr.stat || usr.restrained()) return - if(!in_range(src, usr)) return + if(..()) + return 1 src.add_fingerprint(usr) usr.set_machine(src) @@ -636,6 +638,9 @@ /obj/machinery/chem_master/attack_ai(mob/user as mob) return src.attack_hand(user) + +/obj/machinery/chem_master/attack_ghost(mob/user as mob) + return src.attack_hand(user) /obj/machinery/chem_master/attack_hand(mob/user as mob) if(stat & BROKEN)