From 3043a4f8c96bd7b9fc952e4158a600799fb825a7 Mon Sep 17 00:00:00 2001 From: lolman360 <22850904+lolman360@users.noreply.github.com> Date: Sat, 21 Dec 2019 12:47:36 +1100 Subject: [PATCH] ghom help --- code/modules/mob/living/inhand_holder.dm | 29 ++++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/code/modules/mob/living/inhand_holder.dm b/code/modules/mob/living/inhand_holder.dm index c5840826c7..d437e0160d 100644 --- a/code/modules/mob/living/inhand_holder.dm +++ b/code/modules/mob/living/inhand_holder.dm @@ -100,22 +100,31 @@ return TRUE /mob/living/AltClick(mob/user) - mob_try_pickup(user) - ..() + . = ..() + if(mob_try_pickup(user)) + return TRUE // I didn't define these for mobs, because you shouldn't be able to breathe out of mobs and using their loc isn't always the logical thing to do. -/obj/item/clothing/head/mob_holder/return_air() - var/atom/location = loc - if(location) - return location.loc.return_air(args) /obj/item/clothing/head/mob_holder/assume_air(datum/gas_mixture/env) var/atom/location = loc - if(location) - return location.loc.assume_air(env) + if(!loc) + return //null + var/turf/T = get_turf(loc) + while(location != T) + location = location.loc + if(ismob(location))) + return location.loc.assume_air(env) + return loc.assume_air(env) /obj/item/clothing/head/mob_holder/remove_air(amount) var/atom/location = loc - if(location) - return location.loc.remove_air(amount) + if(!loc) + return //null + var/turf/T = get_turf(loc) + while(location != T) + location = location.loc + if(ismob(location))) + return location.loc.remove_air(amount) + return loc.remove_air(amount)