From f245529511044e35737c9de22dba37d27dc03b1b Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Tue, 22 May 2018 06:25:29 -0700
Subject: [PATCH 1/2] Chasms no longer drop those buckled to undroppable
objects (#37970)
* Chasms no longer drop those buckled to undroppable objects
* Moves a check down for efficiency/not needing to check things twice
* Change logic order so this hack works
---
code/datums/components/chasm.dm | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/code/datums/components/chasm.dm b/code/datums/components/chasm.dm
index 49cb97774c..88360194b3 100644
--- a/code/datums/components/chasm.dm
+++ b/code/datums/components/chasm.dm
@@ -64,18 +64,22 @@
if(is_type_in_typecache(AM, forbidden_types) || AM.throwing || AM.floating)
return FALSE
//Flies right over the chasm
- if(isliving(AM))
+ if(ismob(AM))
var/mob/M = AM
+ if(M.buckled) //middle statement to prevent infinite loops just in case!
+ var/mob/buckled_to = M.buckled
+ if((!ismob(M.buckled) || (buckled_to.buckled != M)) && !droppable(M.buckled))
+ return FALSE
if(M.is_flying())
return FALSE
- if(ishuman(AM))
- var/mob/living/carbon/human/H = AM
- if(istype(H.belt, /obj/item/wormhole_jaunter))
- var/obj/item/wormhole_jaunter/J = H.belt
- //To freak out any bystanders
- H.visible_message("[H] falls into [parent]!")
- J.chasm_react(H)
- return FALSE
+ if(ishuman(AM))
+ var/mob/living/carbon/human/H = AM
+ if(istype(H.belt, /obj/item/wormhole_jaunter))
+ var/obj/item/wormhole_jaunter/J = H.belt
+ //To freak out any bystanders
+ H.visible_message("[H] falls into [parent]!")
+ J.chasm_react(H)
+ return FALSE
return TRUE
/datum/component/chasm/proc/drop(atom/movable/AM)