Skip to content

Commit

Permalink
Merge pull request tgstation#5910 from Razharas/PipeFix
Browse files Browse the repository at this point in the history
Fixes qdel kidnapping pipes
  • Loading branch information
hornygranny committed Nov 24, 2014
2 parents cd9a8a5 + 9a0f3f0 commit 6d6835e
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions code/ATMOSPHERICS/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,13 @@ Pipelines + Other Objects -> Pipe network
return 1
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
add_fingerprint(user)
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
user << "<span class='danger'>You cannot unwrench this [src], it is too exerted due to internal pressure.</span>"
add_fingerprint(user)
return 1
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
add_fingerprint(user)
if (do_after(user, 40))
if (do_after(user, 40) && !gc_destroyed)
user.visible_message( \
"[user] unfastens \the [src].", \
"<span class='notice'>You have unfastened \the [src].</span>", \
Expand All @@ -94,16 +93,15 @@ Pipelines + Other Objects -> Pipe network
return ..()

/obj/machinery/atmospherics/Deconstruct()
if(can_unwrench)
var/turf/T = loc
stored.loc = T
transfer_fingerprints_to(stored)
if(istype(src, /obj/machinery/atmospherics/pipe))
for(var/obj/machinery/meter/meter in T)
if(meter.target == src)
new /obj/item/pipe_meter(T)
qdel(meter)
qdel(src)
var/turf/T = loc
stored.loc = T
transfer_fingerprints_to(stored)
if(istype(src, /obj/machinery/atmospherics/pipe))
for(var/obj/machinery/meter/meter in T)
if(meter.target == src)
new /obj/item/pipe_meter(T)
qdel(meter)
qdel(src)

/obj/machinery/atmospherics/proc/nullifyPipenet(datum/pipeline/P)
P.other_atmosmch -= src
Expand Down

0 comments on commit 6d6835e

Please sign in to comment.