From 13e83b00d154ce743506881819a938235f630e37 Mon Sep 17 00:00:00 2001 From: Screemonster Date: Sun, 4 Mar 2018 00:47:07 +0000 Subject: [PATCH] Makes drills report faults over supply channel (#4989) * Makes drills report faults over supply channel * too chatte * caps and punctuation are important --- code/modules/mining/drilling/drill.dm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index 9cdac912db..bc89c498d2 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -15,6 +15,7 @@ var/supported = 0 var/active = 0 var/list/resource_field = list() + var/obj/item/device/radio/intercom/faultreporter = new /obj/item/device/radio/intercom{channels=list("Supply")}(null) var/ore_types = list( "hematite" = /obj/item/weapon/ore/iron, @@ -60,7 +61,7 @@ if(!active) return if(!anchored || !use_cell_power()) - system_error("system configuration or charge error") + system_error("System configuration or charge error.") return if(need_update_field) @@ -85,7 +86,10 @@ harvesting.has_resources = 0 harvesting.resources = null resource_field -= harvesting - harvesting = pick(resource_field) + if(resource_field.len) // runtime protection + harvesting = pick(resource_field) + else + harvesting = null if(!harvesting) return @@ -95,7 +99,7 @@ for(var/metal in ore_types) if(contents.len >= capacity) - system_error("insufficient storage space") + system_error("Insufficient storage space.") active = 0 need_player_check = 1 update_icon() @@ -131,12 +135,19 @@ active = 0 need_player_check = 1 update_icon() + system_error("Resources depleted.") /obj/machinery/mining/drill/attack_ai(var/mob/user as mob) return src.attack_hand(user) /obj/machinery/mining/drill/attackby(obj/item/O as obj, mob/user as mob) if(!active) + if(istype(O, /obj/item/device/multitool)) + var/newtag = text2num(sanitizeSafe(input(user, "Enter new ID number or leave empty to cancel.", "Assign ID number") as text, 4)) + if(newtag) + name = "[initial(name)] #[newtag]" + to_chat(user, "You changed the drill ID to: [newtag]") + return if(default_deconstruction_screwdriver(user, O)) return if(default_deconstruction_crowbar(user, O)) @@ -234,6 +245,7 @@ if(error) src.visible_message("\The [src] flashes a '[error]' warning.") + faultreporter.autosay(error, src.name, "Supply") need_player_check = 1 active = 0 update_icon()