Skip to content

Commit

Permalink
Fixes SSchunks duplication cases (Stairs , Fallingoff) (discordia-spa…
Browse files Browse the repository at this point in the history
…ce#8508)

* Update atoms_movable.dm

* Fixes for test.

* Update step_override.dm

* Update step_override.dm

* Update atoms_movable.dm
  • Loading branch information
MLGTASTICa authored and MysticalFaceLesS committed Aug 9, 2024
1 parent be91958 commit eef435a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion code/modules/unit_tests/step_override.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit eef435a

Please sign in to comment.