From 3a583b88d1ab68ca58e185da7cac9841d8270cd3 Mon Sep 17 00:00:00 2001 From: Atlantiscze Date: Tue, 12 May 2015 21:47:52 +0200 Subject: [PATCH] Runtime Fix + Examine - Fixes rare runtime which sometimes occured with AI's powersupply object when AI was deleted. - Examine of malf AI now correctly shows information about AI's backup charge and hardware (if AI has hardware installed) --- code/modules/mob/living/silicon/ai/ai.dm | 1 + code/modules/mob/living/silicon/ai/examine.dm | 25 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 6a03af3b119..70be4014f2d 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -245,6 +245,7 @@ var/list/ai_verbs_default = list( /obj/machinery/ai_powersupply/process() if(!powered_ai || powered_ai.stat & DEAD) qdel() + return if(powered_ai.APU_power) use_power = 0 return diff --git a/code/modules/mob/living/silicon/ai/examine.dm b/code/modules/mob/living/silicon/ai/examine.dm index 286edc2ce0f..4caefb236bf 100644 --- a/code/modules/mob/living/silicon/ai/examine.dm +++ b/code/modules/mob/living/silicon/ai/examine.dm @@ -17,15 +17,36 @@ msg += "It looks slightly charred.\n" else msg += "Its casing is melted and heat-warped!\n" + if (src.getOxyLoss()) + if (src.getOxyLoss() > 175) + msg += "It seems to be running on backup power. It's display is blinking \"BACKUP POWER CRITICAL\" warning.\n" + else if(src.getOxyLoss() > 100) + msg += "It seems to be running on backup power. It's display is blinking \"BACKUP POWER LOW\" warning.\n" + else + msg += "It seems to be running on backup power.\n" if (src.stat == UNCONSCIOUS) msg += "It is non-responsive and displaying the text: \"RUNTIME: Sensory Overload, stack 26/3\".\n" msg += "" msg += "*---------*" - + if(hardware) + msg += "\n" + if(istype(hardware, /datum/malf_hardware/apu_gen)) + msg += "It seems to have some sort of power generator attached to it's core." + if(hardware_integrity() < 50) + msg += " It seems to be too damaged to function properly." + else if(APU_power) + msg += "The generator appears to be active." + else if(istype(hardware, /datum/malf_hardware/core_bomb)) + msg += "It seems to have grey blocks of unknown substance and some circuitry connected to it's core. [bombing_core ? "Red light is blinking on the circuit." : ""]" + else if(istype(hardware, /datum/malf_hardware/dual_cpu)) + msg += "It seems to have additional CPU connected to it's core." + else if(istype(hardware, /datum/malf_hardware/dual_ram)) + msg += "It seems to have additional memory blocks connected to it's core." + else if(istype(hardware, /datum/malf_hardware/strong_turrets)) + msg += "It seems to have extra wiring running from it's core to nearby turrets." user << msg user.showLaws(src) - return /mob/proc/showLaws(var/mob/living/silicon/S)