From 4fbdf9851da7aabafa1960ed5575a4ae84703005 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Fri, 21 Jul 2017 18:19:49 -0500 Subject: [PATCH] Fixes a drone ping issue --- code/game/objects/items/devices/PDA/PDA.dm | 6 +++--- .../mob/living/simple_animal/friendly/drone/say.dm | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index a67ca4094b..9c74638fcc 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -383,11 +383,11 @@ GLOBAL_LIST_EMPTY(PDAs) else if((!isnull(cartridge)) && (cartridge.access & CART_ATMOS)) scanmode = 5 if("Drone Phone") - var/area/A = get_area(U) var/alert_s = input(U,"Alert severity level","Ping Drones",null) as null|anything in list("Low","Medium","High","Critical") - if(A && alert_s) + var/area/A = get_area(U) + if(A && alert_s && !QDELETED(U)) var/msg = "NON-DRONE PING: [U.name]: [alert_s] priority alert in [A.name]!" - _alert_drones(msg, TRUE) + _alert_drones(msg, TRUE, U) to_chat(U, msg) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/say.dm b/code/modules/mob/living/simple_animal/friendly/drone/say.dm index 4462adfe9d..bbf3fdc63f 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/say.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/say.dm @@ -17,7 +17,7 @@ //Base proc for anything to call -/proc/_alert_drones(msg, dead_can_hear = 0, mob/living/faction_checked_mob, exact_faction_match) +/proc/_alert_drones(msg, dead_can_hear = 0, atom/source, mob/living/faction_checked_mob, exact_faction_match) for(var/W in GLOB.mob_list) var/mob/living/simple_animal/drone/M = W if(istype(M) && M.stat != DEAD) @@ -26,14 +26,14 @@ to_chat(M, msg) else to_chat(M, msg) - if(dead_can_hear && (M in GLOB.dead_mob_list)) - var/link = FOLLOW_LINK(M, faction_checked_mob) + if(dead_can_hear && source && (M in GLOB.dead_mob_list)) + var/link = FOLLOW_LINK(M, source) to_chat(M, "[link] [msg]") //Wrapper for drones to handle factions /mob/living/simple_animal/drone/proc/alert_drones(msg, dead_can_hear = FALSE) - _alert_drones(msg, dead_can_hear, src, TRUE) + _alert_drones(msg, dead_can_hear, src, src, TRUE) /mob/living/simple_animal/drone/proc/drone_chat(msg)