From ecf699562f8e32b6c2f02bf54c5f84ce375ed447 Mon Sep 17 00:00:00 2001 From: SteelSlayer Date: Sun, 10 May 2020 14:50:41 -0500 Subject: [PATCH] Fixes a few runtimes --- code/_onclick/item_attack.dm | 2 +- code/game/gamemodes/miniantags/bot_swarm/swarmer.dm | 2 +- code/game/objects/items/weapons/handcuffs.dm | 3 +++ code/game/turfs/simulated/floor.dm | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index d2a91da4020..e27002cf118 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -58,7 +58,7 @@ else return 1 var/obj/item/organ/external/O = M.get_organ(user.zone_selected) - if((is_sharp(src) || (isscrewdriver(src) && O.is_robotic())) && user.a_intent == INTENT_HELP) + if((is_sharp(src) || (isscrewdriver(src) && O?.is_robotic())) && user.a_intent == INTENT_HELP) if(!attempt_initiate_surgery(src, M, user)) return FALSE else diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index 65424bf9008..f425a34654d 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -421,13 +421,13 @@ return FALSE /obj/structure/lattice/catwalk/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) - . = ..() var/turf/here = get_turf(src) for(var/A in here.contents) var/obj/structure/cable/C = A if(istype(C)) to_chat(S, "Disrupting the power grid would bring no benefit to us. Aborting.") return FALSE + return ..() /obj/item/deactivated_swarmer/IntegrateAmount() return 50 diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index e188279eb8c..1f73e5c7062 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -37,6 +37,9 @@ cuff(C, user) /obj/item/restraints/handcuffs/proc/cuff(mob/living/carbon/C, mob/user, remove_src = TRUE) + if(!istype(C)) // Shouldn't be able to cuff anything but carbons. + return + if(ishuman(C)) var/mob/living/carbon/human/H = C if(!(H.has_left_hand() || H.has_right_hand())) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index e425c3458c3..2d886f44bfd 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -187,7 +187,7 @@ GLOBAL_LIST_INIT(icons_to_ignore_at_floor_init, list("damaged1","damaged2","dama if(T.turf_type == type) return var/obj/item/thing = user.get_inactive_hand() - if(!prying_tool_list.Find(thing.tool_behaviour)) + if(!thing || !prying_tool_list.Find(thing.tool_behaviour)) return var/turf/simulated/floor/plating/P = pry_tile(thing, user, TRUE) if(!istype(P))