Canisters detach from ports if they get destroyed (#7967)

This commit is contained in:
Guti
2024-03-15 13:49:26 +01:00
committed by GitHub
parent 1f7b75dc18
commit bc4b0df30b
2 changed files with 6 additions and 1 deletions
@@ -168,8 +168,13 @@ update_flag
if (src.health <= 10)
var/atom/location = src.loc
var/obj/machinery/atmospherics/portables_connector/port = locate() in location // CHOMPEdit - Finds if there's a port
location.assume_air(air_contents)
if(port && anchored) // CHOMPEdit - if it blew up, frees up the port
disconnect()
anchored = 0
src.destroyed = 1
playsound(src, 'sound/effects/spray.ogg', 10, 1, -3)
src.density = FALSE
@@ -117,7 +117,7 @@
update_icon()
return
else if (W.has_tool_quality(TOOL_WRENCH))
else if (W.has_tool_quality(TOOL_WRENCH) && !(src.destroyed)) // CHOMPEdit - Make sure it's not broken
if(connected_port)
disconnect()
to_chat(user, "<span class='notice'>You disconnect \the [src] from the port.</span>")