From 0135051498b00883e6a70686c513b5cbeb330124 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Sun, 7 Jun 2015 06:43:50 +0200 Subject: [PATCH] Fixes #9706 - Adds checks whether the turf exists. This should prevent runtimes. - Moves ..() call in food/snacks/grown after seed.thrown_at() call. I believe this was causing the runtime in first place. --- code/modules/hydroponics/grown.dm | 2 +- code/modules/hydroponics/seed.dm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 8b7678f19f..931ce29d19 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -167,8 +167,8 @@ return /obj/item/weapon/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom) - ..() if(seed) seed.thrown_at(src,hit_atom) + ..() /obj/item/weapon/reagent_containers/food/snacks/grown/attackby(var/obj/item/weapon/W, var/mob/user) diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 9fd666fbb6..59bc3481d9 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -229,7 +229,8 @@ for(var/mob/living/M in T.contents) apply_special_effect(M) splatter(T,thrown) - origin_turf.visible_message("The [thrown.name] explodes!") + if(origin_turf) + origin_turf.visible_message("The [thrown.name] explodes!") qdel(thrown) return @@ -242,7 +243,8 @@ if(get_trait(TRAIT_JUICY) && splatted) splatter(origin_turf,thrown) - origin_turf.visible_message("The [thrown.name] splatters against [target]!") + if(origin_turf) + origin_turf.visible_message("The [thrown.name] splatters against [target]!") qdel(thrown) /datum/seed/proc/handle_environment(var/turf/current_turf, var/datum/gas_mixture/environment, var/light_supplied, var/check_only)