Skip to content

Commit

Permalink
Fixes conga lines breaking when going up/down stairs. (tgstation#84156)
Browse files Browse the repository at this point in the history
## About The Pull Request

Last PR I fixed ladders and no-grav conga lines, but I couldn't figure
out stairs. I have returned to it and after several fucking hours I
figured it out.

Fixes conga lines of more than 2 breaking when pulling them up and down
stairs. You can now go up and down stairs with conga lines of arbitrary
length!

## Why It's Good For The Game

Bug fix good.

## Changelog
:cl:
fix: Conga lines of more than 2 no longer break when going up and down
stairs.
/:cl:
  • Loading branch information
JupiterJaeden authored Jun 21, 2024
1 parent 1eab8bd commit 1e74f4b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@
stop_pulling()
else if(pulling.anchored || pulling.move_resist > move_force)
stop_pulling()
if(!only_pulling && pulledby && moving_diagonally != FIRST_DIAG_STEP && (get_dist(src, pulledby) > 1 || z != pulledby.z)) //separated from our puller and not in the middle of a diagonal move.
if(!only_pulling && pulledby && moving_diagonally != FIRST_DIAG_STEP && (get_dist(src, pulledby) > 1 || (z != pulledby.z && !z_allowed))) //separated from our puller and not in the middle of a diagonal move.
pulledby.stop_pulling()

/atom/movable/proc/set_glide_size(target = 8)
Expand Down Expand Up @@ -792,7 +792,14 @@

if(target_turf != current_turf || (moving_diagonally != SECOND_DIAG_STEP && ISDIAGONALDIR(pull_dir)) || get_dist(src, pulling) > 1)
pulling.move_from_pull(src, target_turf, glide_size)
check_pulling()
if (pulledby)
if (pulledby.currently_z_moving)
check_pulling(z_allowed = TRUE)
//dont call check_pulling() here at all if there is a pulledby that is not currently z moving
//because it breaks stair conga lines, for some fucking reason.
//it's fine because the pull will be checked when this whole proc is called by the mob doing the pulling anyways
else
check_pulling()

//glide_size strangely enough can change mid movement animation and update correctly while the animation is playing
//This means that if you don't override it late like this, it will just be set back by the movement update that's called when you move turfs.
Expand Down

0 comments on commit 1e74f4b

Please sign in to comment.