From eef435a4b642480b1dd128cbbf28cda5ece27d4b Mon Sep 17 00:00:00 2001 From: MLGTASTICa <61350382+MLGTASTICa@users.noreply.github.com> Date: Fri, 9 Aug 2024 19:43:56 +0300 Subject: [PATCH] Fixes SSchunks duplication cases (Stairs , Fallingoff) (#8508) * Update atoms_movable.dm * Fixes for test. * Update step_override.dm * Update step_override.dm * Update atoms_movable.dm --- code/game/atoms_movable.dm | 4 ++++ code/modules/unit_tests/step_override.dm | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index f77bf341108..83404621f8f 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -338,7 +338,11 @@ var/atom/oldloc = src.loc var/olddir = dir //we can't override this without sacrificing the rest of movable/New() + // Movement has either failed by Bump(), or we get moved to a new Turf after entering + // Either way , both should count as failures, the move is not on the aimed turf after all -SPCR 2024 . = ..() + if(!. || loc != NewLoc) + return FALSE if(Dir != olddir) dir = olddir diff --git a/code/modules/unit_tests/step_override.dm b/code/modules/unit_tests/step_override.dm index 1b849ef4d5d..fcf4840821f 100644 --- a/code/modules/unit_tests/step_override.dm +++ b/code/modules/unit_tests/step_override.dm @@ -11,8 +11,11 @@ /datum/unit_test/step_override/proc/TestStep(type_to_test) var/atom/movable/AM = allocate(type_to_test) // alloc spawns them at 20,20,1||20,21,1 var/turf/T = get_turf(AM) + var/turf/D = locate(T.x, T.y + 1, T.z) + T.ChangeTurf(/turf/floor) + D.ChangeTurf(/turf/floor) . = step(AM, NORTH) . = . && T.x == AM.x - . = . && T.y + 1 == AM.y // eh? + . = . && (T.y + 1) == AM.y // eh? . = . && T.z == AM.z