Skip to content

Commit

Permalink
[MIRROR] Fixes a small issue with disposal outlets. [MDB IGNORE] (#640)
Browse files Browse the repository at this point in the history
* Fixes a small issue with disposal outlets. (#79706)

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Ghom <[email protected]>
  • Loading branch information
3 people authored Nov 15, 2023
1 parent e163dce commit d26011c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
14 changes: 7 additions & 7 deletions code/modules/recycling/disposal/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if(M.client)
M.reset_perspective(src)
hasmob = TRUE
RegisterSignal(M, COMSIG_LIVING_RESIST, PROC_REF(struggle_prep), M)
RegisterSignal(M, COMSIG_LIVING_RESIST, PROC_REF(struggle_prep))

//Checks 1 contents level deep. This means that players can be sent through disposals mail...
//...but it should require a second person to open the package. (i.e. person inside a wrapped locker)
Expand Down Expand Up @@ -179,12 +179,12 @@

/// Merge two holder objects, used when a holder meets a stuck holder
/obj/structure/disposalholder/proc/merge(obj/structure/disposalholder/other)
for(var/A in other)
var/atom/movable/AM = A
AM.forceMove(src) // move everything in other holder to this one
if(ismob(AM))
var/mob/M = AM
M.reset_perspective(src) // if a client mob, update eye to follow this holder
for(var/atom/movable/movable as anything in other)
movable.forceMove(src) // move everything in other holder to this one
if(ismob(movable))
var/mob/mob = movable
mob.reset_perspective(src) // if a client mob, update eye to follow this holder
RegisterSignal(mob, COMSIG_LIVING_RESIST, PROC_REF(struggle_prep))
hasmob = TRUE
if(destinationTag == 0 && other.destinationTag != 0)
destinationTag = other.destinationTag
Expand Down
7 changes: 6 additions & 1 deletion code/modules/recycling/disposal/outlet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@

/obj/structure/disposaloutlet/Destroy()
if(trunk)
// preemptively expel the contents from the trunk
// in case the outlet is deleted before expel_holder could be called.
var/obj/structure/disposalholder/holder = locate() in trunk
if(holder)
trunk.expel(holder)
trunk.linked = null
trunk = null
QDEL_NULL(stored)
Expand All @@ -68,7 +73,7 @@
if(playsound)
playsound(src, 'sound/machines/hiss.ogg', 50, FALSE, FALSE)

if(!H)
if(QDELETED(H))
return

pipe_eject(H, dir, TRUE, target, eject_range, eject_speed)
Expand Down

0 comments on commit d26011c

Please sign in to comment.