Merge pull request #9694 from farie82/Disposals-move-fix

Fixes bluespace disposal bins and broken disposals due to the instant recall spell and meteor shot
This commit is contained in:
variableundefined
2018-10-07 15:27:23 +08:00
committed by GitHub
2 changed files with 41 additions and 2 deletions
+3 -2
View File
@@ -93,9 +93,10 @@
var/obj/machinery/portable_atmospherics/P = item_to_retrive.loc
P.disconnect()
P.update_icon()
if(istype(item_to_retrive.loc, /obj/structure/disposalholder) || istype(item_to_retrive.loc, /obj/machinery/disposal))//fixes the breaking of disposals. No more bluespace connected disposal bins!
break
item_to_retrive = item_to_retrive.loc
infinite_recursion += 1
if(!item_to_retrive)
+38
View File
@@ -45,6 +45,26 @@
flush = initial(flush)
T.nicely_link_to_other_stuff(src)
//When the disposalsoutlet is forcefully moved. Due to meteorshot (not the recall spell)
/obj/machinery/disposal/Moved(atom/OldLoc, Dir)
. = ..()
eject()
var/ptype = istype(src, /obj/machinery/disposal/deliveryChute) ? PIPE_DISPOSALS_CHUTE : PIPE_DISPOSALS_BIN //Check what disposaltype it is
var/turf/T = OldLoc
if(T.intact)
var/turf/simulated/floor/F = T
F.remove_tile(null,TRUE,TRUE)
T.visible_message("<span class='warning'>The floortile is ripped from the floor!</span>", "<span class='warning'>You hear a loud bang!</span>")
if(trunk)
trunk.remove_trunk_links()
var/obj/structure/disposalconstruct/C = new (loc)
transfer_fingerprints_to(C)
C.ptype = ptype
C.update()
C.anchored = 0
C.density = 1
qdel(src)
/obj/machinery/disposal/Destroy()
eject()
if(trunk)
@@ -1345,6 +1365,24 @@
to_chat(user, "You need more welding fuel to complete this task.")
return
//When the disposalsoutlet is forcefully moved. Due to meteorshot or the recall item spell for instance
/obj/structure/disposaloutlet/Moved(atom/OldLoc, Dir)
. = ..()
var/turf/T = OldLoc
if(T.intact)
var/turf/simulated/floor/F = T
F.remove_tile(null,TRUE,TRUE)
T.visible_message("<span class='warning'>The floortile is ripped from the floor!</span>", "<span class='warning'>You hear a loud bang!</span>")
if(linkedtrunk)
linkedtrunk.remove_trunk_links()
var/obj/structure/disposalconstruct/C = new (loc)
transfer_fingerprints_to(C)
C.ptype = PIPE_DISPOSALS_OUTLET
C.update()
C.anchored = 0
C.density = 1
qdel(src)
/obj/structure/disposaloutlet/Destroy()
if(linkedtrunk)
linkedtrunk.remove_trunk_links()