Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 74e553b

Browse files
gay
1 parent ce41b9a commit 74e553b

File tree

1 file changed

+15
-5
lines changed
  • code/modules/atmospherics/machinery/components/unary_devices

1 file changed

+15
-5
lines changed

code/modules/atmospherics/machinery/components/unary_devices/tank.dm

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
)
2626

2727
var/volume = 10000 //in liters
28-
var/gas_type = 0
28+
var/gas_type = null
2929

3030
/obj/machinery/atmospherics/components/unary/tank/Initialize(mapload)
3131
. = ..()
@@ -39,23 +39,33 @@
3939

4040
/obj/machinery/atmospherics/components/unary/tank/attackby(obj/item/I, mob/user, params)
4141
var/datum/gas_mixture/air_contents = airs[1]
42-
default_deconstruction_screwdriver(user, icon_state, icon_state, I)
43-
if(panel_open || air_contents.total_moles() < 1000)
42+
if(default_deconstruction_screwdriver(user, icon_state, icon_state, I))
43+
change_pipe_connection(!anchored)
44+
return
45+
if(panel_open)
4446
if(default_unfasten_wrench(user, I, 10))
45-
change_pipe_connection(!anchored)
47+
dump_gas()
4648
return
4749
else
4850
to_chat(user, span_warning("[panel_open? "Too much gas inside, make sure it's below 1000 moles!" : "Open the panel first!"]"))
4951
return
5052
return ..()
5153

5254
/obj/machinery/atmospherics/components/unary/tank/attackby_secondary(obj/item/I, mob/user, params)
53-
if(!anchored)
55+
if(panel_open)
5456
if(default_change_direction_wrench(user, I))
5557
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
5658
else
5759
return SECONDARY_ATTACK_CALL_NORMAL
5860

61+
/obj/machinery/atmospherics/components/unary/tank/proc/dump_gas()
62+
var/datum/gas_mixture/contents = airs[1]
63+
var/datum/pipeline/pipe = parents[1]
64+
for(var/gas_id in contents.get_gases())
65+
var/gas_removed = contents.get_moles(gas_id)
66+
contents.adjust_moles(gas_id, -gas_removed)
67+
pipe.air.adjust_moles(gas_id, gas_removed)
68+
5969
/obj/machinery/atmospherics/components/unary/tank/default_change_direction_wrench(mob/user, obj/item/I)
6070
if(!..())
6171
return FALSE

0 commit comments

Comments
 (0)