From 3f058f73465150ed59bb80b42ee5d18113dfffcd Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Mon, 16 Dec 2024 01:02:48 +0100 Subject: [PATCH] fix multizmovement (#16702) --- code/modules/multiz/movement.dm | 5 ++--- code/modules/multiz/turf.dm | 13 ++++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index 64fc76ae390..1153f9b8e5c 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -115,11 +115,10 @@ to_chat(src, span_warning("You gave up on pulling yourself up.")) return 0 - //RS Port #661 Start, Prevents noclipping - else if(!istype(destination, /turf/simulated/open)) + // Explicit check if the destination turf allows full passing + else if(!destination.CanZPass(src, direction)) to_chat(src, span_warning("Something solid above stops you from passing.")) return 0 - //RS Port #661 End else if(isliving(src)) //VOREStation Edit Start. Are they a mob, and are they currently flying?? var/mob/living/H = src diff --git a/code/modules/multiz/turf.dm b/code/modules/multiz/turf.dm index 31afd8f6c7d..524f6926e50 100644 --- a/code/modules/multiz/turf.dm +++ b/code/modules/multiz/turf.dm @@ -1,20 +1,23 @@ /// Multiz support override for CanZPass -/turf/proc/CanZPass(atom/A, direction) +/turf/proc/CanZPass(atom/A, direction, recursive = FALSE) + if(recursive) + return FALSE if(z == A.z) //moving FROM this turf return direction == UP //can't go below else if(direction == UP) //on a turf below, trying to enter - return 0 + return FALSE if(direction == DOWN) //on a turf above, trying to enter - return !density && isopenspace(GetAbove(src)) // VOREStation Edit + var/turf/above = GetAbove(src) + return !density && above?.CanZPass(A, direction, TRUE) // do not call the function again, only accept overrides that return TRUE for a direction /// Multiz support override for CanZPass /turf/simulated/open/CanZPass(atom, direction) - return 1 + return TRUE /// Multiz support override for CanZPass /turf/space/CanZPass(atom, direction) - return 1 + return TRUE /// WARNING WARNING /// Turfs DO NOT lose their signals when they get replaced, REMEMBER THIS