Skip to content

Commit

Permalink
[MIRROR] Fixes being permanently attached to tram (#2796)
Browse files Browse the repository at this point in the history
* Fixes being permanently attached to tram (#83606)

## About The Pull Request

Verifies transport contents at time of tram departure, removing any
invalid movables

Fixes tgstation/tgstation#77722

## Why It's Good For The Game

Movables no longer get invisibly, permanently attached to the tram in
rare event transport moves before contents are updated.

## Changelog

:cl: LT3
fix: Fixed bug where players could be invisibly attached to the tram
forever
/:cl:

* Fixes being permanently attached to tram

---------

Co-authored-by: lessthanthree <[email protected]>
Co-authored-by: NovaBot13 <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Jun 1, 2024
1 parent e5c22db commit 5eb6116
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/modules/transport/tram/tram_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
for(var/obj/structure/transport/linear/tram/transport_module as anything in transport_modules) //only thing everyone needs to know is the new location.
if(transport_module.travelling) //wee woo wee woo there was a double action queued. damn multi tile structs
return //we don't care to undo cover_locked controls, though, as that will resolve itself
transport_module.verify_transport_contents()
transport_module.glide_size_override = DELAY_TO_GLIDE_SIZE(speed_limiter)
transport_module.set_travelling(TRUE)

Expand Down
6 changes: 6 additions & 0 deletions code/modules/transport/transport_module.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@

initial_contents += new_initial_contents

///verify the movables in our list of contents are actually on our loc
/obj/structure/transport/linear/proc/verify_transport_contents()
for(var/atom/movable/movable_contents as anything in transport_contents)
if(!(movable_contents.loc in locs))
remove_item_from_transport(movable_contents)

///signal handler for COMSIG_MOVABLE_UPDATE_GLIDE_SIZE: when a movable in transport_contents changes its glide_size independently.
///adds that movable to a lazy list, movables in that list have their glide_size updated when the tram next moves
/obj/structure/transport/linear/proc/on_changed_glide_size(atom/movable/moving_contents, new_glide_size)
Expand Down

0 comments on commit 5eb6116

Please sign in to comment.