From c032a297da908778ecccc5028bf3bac3785a51f8 Mon Sep 17 00:00:00 2001 From: Mechoid Date: Wed, 2 May 2018 19:00:17 -0700 Subject: [PATCH] Tenth time's the charm. Fix upload console runtimes by passing module.install user. --- code/game/machinery/computer/law.dm | 114 +++++++++--------- .../game/machinery/computer3/computers/law.dm | 108 ++++++++--------- 2 files changed, 111 insertions(+), 111 deletions(-) diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 5703c90c8a3..7a241cdd7fc 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -10,50 +10,50 @@ var/opened = 0 - verb/AccessInternals() - set category = "Object" - set name = "Access Computer's Internals" - set src in oview(1) - if(get_dist(src, usr) > 1 || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon)) - return - - opened = !opened - if(opened) - usr << "The access panel is now open." - else - usr << "The access panel is now closed." +/obj/machinery/computer/aiupload/verb/AccessInternals() + set category = "Object" + set name = "Access Computer's Internals" + set src in oview(1) + if(get_dist(src, usr) > 1 || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon)) return - - attackby(obj/item/weapon/O as obj, mob/user as mob) - if (using_map && !(user.z in using_map.contact_levels)) - user << "Unable to establish a connection: You're too far away from the station!" - return - if(istype(O, /obj/item/weapon/aiModule)) - var/obj/item/weapon/aiModule/M = O - M.install(src, user) - else - ..() + opened = !opened + if(opened) + to_chat(usr, "The access panel is now open.") + else + to_chat(usr, "The access panel is now closed.") + return - attack_hand(var/mob/user as mob) - if(src.stat & NOPOWER) - usr << "The upload computer has no power!" - return - if(src.stat & BROKEN) - usr << "The upload computer is broken!" - return +/obj/machinery/computer/aiupload/attackby(obj/item/weapon/O as obj, mob/user as mob) + if (using_map && !(user.z in using_map.contact_levels)) + to_chat(user, "Unable to establish a connection: You're too far away from the station!") + return + if(istype(O, /obj/item/weapon/aiModule)) + var/obj/item/weapon/aiModule/M = O + M.install(src, user) + else + ..() - src.current = select_active_ai(user) - if (!src.current) - usr << "No active AIs detected." - else - usr << "[src.current.name] selected for law changes." +/obj/machinery/computer/aiupload/attack_hand(var/mob/user as mob) + if(src.stat & NOPOWER) + to_chat(user, "The upload computer has no power!") + return + if(src.stat & BROKEN) + to_chat(user, "The upload computer is broken!") return - attack_ghost(user as mob) - return 1 + src.current = select_active_ai(user) + + if (!src.current) + to_chat(user, "No active AIs detected.") + else + to_chat(user, "[src.current.name] selected for law changes.") + return + +/obj/machinery/computer/aiupload/attack_ghost(user as mob) + return 1 /obj/machinery/computer/borgupload @@ -65,28 +65,28 @@ var/mob/living/silicon/robot/current = null - attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) - if(istype(module, /obj/item/weapon/aiModule)) - module.install(src) - else - return ..() +/obj/machinery/computer/borgupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) + if(istype(module, /obj/item/weapon/aiModule)) + module.install(src, user) + else + return ..() - attack_hand(var/mob/user as mob) - if(src.stat & NOPOWER) - usr << "The upload computer has no power!" - return - if(src.stat & BROKEN) - usr << "The upload computer is broken!" - return - - src.current = freeborg() - - if (!src.current) - usr << "No free cyborgs detected." - else - usr << "[src.current.name] selected for law changes." +/obj/machinery/computer/borgupload/attack_hand(var/mob/user as mob) + if(src.stat & NOPOWER) + to_chat(user, "The upload computer has no power!") + return + if(src.stat & BROKEN) + to_chat(user, "The upload computer is broken!") return - attack_ghost(user as mob) - return 1 + src.current = freeborg() + + if (!src.current) + to_chat(user, "No free cyborgs detected.") + else + to_chat(user, "[src.current.name] selected for law changes.") + return + +/obj/machinery/computer/borgupload/attack_ghost(user as mob) + return 1 diff --git a/code/game/machinery/computer3/computers/law.dm b/code/game/machinery/computer3/computers/law.dm index 7d9b47ff0b0..e79b09c9e94 100644 --- a/code/game/machinery/computer3/computers/law.dm +++ b/code/game/machinery/computer3/computers/law.dm @@ -9,46 +9,46 @@ var/opened = 0 - verb/AccessInternals() - set category = "Object" - set name = "Access Computer's Internals" - set src in oview(1) - if(!Adjacent(usr) || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon) || !istype(usr, /mob/living)) - return - - opened = !opened - if(opened) - usr << "The access panel is now open." - else - usr << "The access panel is now closed." +/obj/machinery/computer3/aiupload/verb/AccessInternals() + set category = "Object" + set name = "Access Computer's Internals" + set src in oview(1) + if(!Adjacent(usr) || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon) || !istype(usr, /mob/living)) return - - attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) - if (user.z > 6) - user << "Unable to establish a connection: You're too far away from the station!" - return - if(istype(module, /obj/item/weapon/aiModule)) - module.install(src) - else - return ..() + opened = !opened + if(opened) + to_chat(usr, "The access panel is now open.") + else + to_chat(usr, "The access panel is now closed.") + return - attack_hand(var/mob/user as mob) - if(src.stat & NOPOWER) - usr << "The upload computer has no power!" - return - if(src.stat & BROKEN) - usr << "The upload computer is broken!" - return - - src.current = select_active_ai(user) - - if (!src.current) - usr << "No active AIs detected." - else - usr << "[src.current.name] selected for law changes." +/obj/machinery/computer3/aiupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) + if (user.z > 6) + to_chat(user, "Unable to establish a connection: You're too far away from the station!") return + if(istype(module, /obj/item/weapon/aiModule)) + module.install(src, user) + else + return ..() + + +/obj/machinery/computer3/aiupload/attack_hand(var/mob/user as mob) + if(src.stat & NOPOWER) + to_chat(user, "The upload computer has no power!") + return + if(src.stat & BROKEN) + to_chat(user, "The upload computer is broken!") + return + + src.current = select_active_ai(user) + + if (!src.current) + to_chat(user, "No active AIs detected.") + else + to_chat(user, "[src.current.name] selected for law changes.") + return @@ -60,25 +60,25 @@ var/mob/living/silicon/robot/current = null - attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) - if(istype(module, /obj/item/weapon/aiModule)) - module.install(src) - else - return ..() +/obj/machinery/computer3/borgupload/attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob) + if(istype(module, /obj/item/weapon/aiModule)) + module.install(src, user) + else + return ..() - attack_hand(var/mob/user as mob) - if(src.stat & NOPOWER) - usr << "The upload computer has no power!" - return - if(src.stat & BROKEN) - usr << "The upload computer is broken!" - return - - src.current = freeborg() - - if (!src.current) - usr << "No free cyborgs detected." - else - usr << "[src.current.name] selected for law changes." +/obj/machinery/computer3/borgupload/attack_hand(var/mob/user as mob) + if(src.stat & NOPOWER) + to_chat(user, "The upload computer has no power!") return + if(src.stat & BROKEN) + to_chat(user, "The upload computer is broken!") + return + + src.current = freeborg() + + if (!src.current) + to_chat(user, "No free cyborgs detected.") + else + to_chat(user, "[src.current.name] selected for law changes.") + return