From 2090a6602315aa45200699614b77979fc201a94a Mon Sep 17 00:00:00 2001 From: Krausus Date: Tue, 18 Aug 2015 02:53:23 -0400 Subject: [PATCH] Fixes various runtimes - Fixes flashers runtiming when flashing someone who lacks eyes. - Fixes chem masters runtiming when told to make 0 pills. - Fixes job objective completion runtiming when someone without a PDA completes a job objective. - Fixes the HUDs of clientless robots runtiming when trying to update. - Fixes T-ray scanners causing runtimes when objects they're making visible get deleted. - Fixes mech bay recharge station turfs runtiming if destroyed while missing a recharging port/console. --- code/_onclick/hud/robot.dm | 2 ++ code/game/gamemodes/game_mode.dm | 2 +- code/game/machinery/flasher.dm | 2 +- code/game/mecha/mech_bay.dm | 11 ++++++++--- code/game/objects/items/devices/scanners.dm | 2 +- code/modules/reagents/Chemistry-Machinery.dm | 1 + 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 9c586c3873e..745f747684f 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -191,6 +191,8 @@ var/mob/living/silicon/robot/r = mymob + if(!r.client) return + if(r.shown_robot_modules) //Modules display is shown r.client.screen += r.throw_icon //"store" icon diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 8fd1c2638bc..7438d5c7978 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -129,7 +129,7 @@ msg += "You have been sent the $[pay], as agreed." else msg += "However, we were unable to send you the $[pay] you're entitled." - if(useMS) + if(useMS && P) // THIS SHOULD HAVE DONE EVERYTHING FOR ME useMS.send_pda_message("[P.owner]", "[command_name()] Payroll", msg) diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 5322c3da301..e32146ff69f 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -82,7 +82,7 @@ if (istype(O, /mob/living/carbon/human)) var/mob/living/carbon/human/H = O var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"] - if ((E.damage > E.min_bruised_damage && prob(E.damage + 50))) + if (E && (E.damage > E.min_bruised_damage && prob(E.damage + 50))) flick("e_flash", O:flash) E.damage += rand(1, 2) else diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index 3f6b92c98ce..42837d06aba 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -13,8 +13,13 @@ temperature = TCMB /turf/simulated/floor/mech_bay_recharge_floor/Destroy() - recharge_console.recharge_floor = null - recharge_port.recharge_floor = null + if(recharge_console && recharge_console.recharge_floor == src) + recharge_console.recharge_floor = null + recharge_console = null + if(recharge_port && recharge_port.recharge_floor == src) + recharge_port.recharge_floor = null + recharge_port = null + recharging_mecha = null ..() /turf/simulated/floor/mech_bay_recharge_floor/Entered(var/obj/mecha/mecha) @@ -285,4 +290,4 @@ // open the new ui window ui.open() // auto update every Master Controller tick - ui.set_auto_update(1) + ui.set_auto_update(1) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 2f23f8d47ba..d090712dea9 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -72,7 +72,7 @@ REAGENT SCANNER spawn(pulse_duration) if(O) var/turf/U = O.loc - if(U.intact) + if(U && U.intact) O.invisibility = 101 O.alpha = 255 for(var/mob/living/M in T.contents) diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 6ffa7a03a46..03dd8cfbcf6 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -562,6 +562,7 @@ var/count = 1 if (href_list["createpill_multiple"]) count = isgoodnumber(input("Select the number of pills to make.", 10, pillamount) as num) if (count > 20) count = 20 //Pevent people from creating huge stacks of pills easily. Maybe move the number to defines? + if (count <= 0) return var/amount_per_pill = reagents.total_volume/count if (amount_per_pill > 50) amount_per_pill = 50 var/name = reject_bad_text(input(usr,"Name:","Name your pill!","[reagents.get_master_reagent_name()] ([amount_per_pill] units)"))