From e9687e294b9b5a42a8c3a70f912b4ae6cd6e3728 Mon Sep 17 00:00:00 2001 From: Heroman Date: Tue, 6 Sep 2022 05:37:37 +1000 Subject: [PATCH] Fixes a few more runtimes --- code/game/dna/dna2_helpers.dm | 8 ++++---- code/game/machinery/deployable_vr.dm | 2 +- code/game/objects/items/weapons/stunbaton.dm | 2 +- code/game/objects/structures/artstuff.dm | 2 +- code/modules/rogueminer_vr/controller.dm | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index 931b2980913..d5cdc700c73 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -22,7 +22,7 @@ // Give Random Bad Mutation to M /proc/randmutb(var/mob/living/M) - if(!M) return + if(!M || !(M.dna)) return M.dna.check_integrity() //var/block = pick(GLASSESBLOCK,COUGHBLOCK,FAKEBLOCK,NERVOUSBLOCK,CLUMSYBLOCK,TWITCHBLOCK,HEADACHEBLOCK,BLINDBLOCK,DEAFBLOCK,HALLUCINATIONBLOCK) // Most of these are disabled anyway. var/block = pick(FAKEBLOCK,CLUMSYBLOCK,BLINDBLOCK,DEAFBLOCK) @@ -30,7 +30,7 @@ // Give Random Good Mutation to M /proc/randmutg(var/mob/living/M) - if(!M) return + if(!M || !(M.dna)) return M.dna.check_integrity() //var/block = pick(HULKBLOCK,XRAYBLOCK,FIREBLOCK,TELEBLOCK,NOBREATHBLOCK,REMOTEVIEWBLOCK,REGENERATEBLOCK,INCREASERUNBLOCK,REMOTETALKBLOCK,MORPHBLOCK,BLENDBLOCK,NOPRINTSBLOCK,SHOCKIMMUNITYBLOCK,SMALLSIZEBLOCK) // Much like above, most of these blocks are disabled in code. var/block = pick(HULKBLOCK,XRAYBLOCK,FIREBLOCK,TELEBLOCK,REGENERATEBLOCK,REMOTETALKBLOCK) @@ -38,13 +38,13 @@ // Random Appearance Mutation /proc/randmuti(var/mob/living/M) - if(!M) return + if(!M || !(M.dna)) return M.dna.check_integrity() M.dna.SetUIValue(rand(1,DNA_UI_LENGTH),rand(1,4095)) // Scramble UI or SE. /proc/scramble(var/UI, var/mob/M, var/prob) - if(!M) return + if(!M || !(M.dna)) return M.dna.check_integrity() if(UI) for(var/i = 1, i <= DNA_UI_LENGTH-1, i++) diff --git a/code/game/machinery/deployable_vr.dm b/code/game/machinery/deployable_vr.dm index bbb835b7631..c939fea3f40 100644 --- a/code/game/machinery/deployable_vr.dm +++ b/code/game/machinery/deployable_vr.dm @@ -72,7 +72,7 @@ /obj/structure/barricade/cutout/attackby(var/obj/I, var/mob/user) if(is_type_in_list(I, painters)) var/choice = tgui_input_list(user, "What would you like to paint the cutout as?", "Cutout Painting", cutout_types) - if(!choice || !Adjacent(user, src) || I != user.get_active_hand()) + if(!choice || !Adjacent(user) || I != user.get_active_hand()) return TRUE if(do_after(user, 10 SECONDS, src)) var/picked_type = cutout_types[choice] diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index f7314010ba3..29cb4630ce6 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -100,7 +100,7 @@ /obj/item/weapon/melee/baton/examine(mob/user) . = ..() - if(Adjacent(user, src)) + if(Adjacent(user)) if(bcell) . += "The baton is [round(bcell.percent())]% charged." if(!bcell) diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index e0b5a2459e1..9bcd59b39f0 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -106,7 +106,7 @@ if(choice == "No") return var/basecolor = input(user, "Select a base color for the canvas:", "Base Color", canvas_color) as null|color - if(basecolor && Adjacent(user, src) && Adjacent(user, I)) + if(basecolor && Adjacent(user) && user.get_active_hand() == I) canvas_color = basecolor reset_grid() user.visible_message("[user] smears paint on [src], covering the entire thing in paint.", "You smear paint on [src], changing the color of the entire thing.", runemessage = "smears paint") diff --git a/code/modules/rogueminer_vr/controller.dm b/code/modules/rogueminer_vr/controller.dm index 4c6c710120d..efff235f2e9 100644 --- a/code/modules/rogueminer_vr/controller.dm +++ b/code/modules/rogueminer_vr/controller.dm @@ -197,6 +197,6 @@ var/datum/controller/rogue/rm_controller rm_controller.dbg("RMC(pnz): Cleaning up oldest zone.") spawn(0) //Detatch it so we can return the new zone for now. var/datum/rogue/zonemaster/ZM_oldest = get_oldest_zone() - ZM_oldest.clean_zone() + if(ZM_oldest) ZM_oldest.clean_zone() return ZM_target \ No newline at end of file