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

Commit c7fc351

Browse files
ye boi
1 parent 74e553b commit c7fc351

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

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

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
var/volume = 10000 //in liters
2828
var/gas_type = null
2929

30-
/obj/machinery/atmospherics/components/unary/tank/Initialize(mapload)
30+
/obj/machinery/atmospherics/components/unary/tank/New()
3131
. = ..()
3232
var/datum/gas_mixture/air_contents = airs[1]
3333
air_contents.set_volume(volume)
@@ -38,22 +38,21 @@
3838
set_piping_layer(piping_layer)
3939

4040
/obj/machinery/atmospherics/components/unary/tank/attackby(obj/item/I, mob/user, params)
41-
var/datum/gas_mixture/air_contents = airs[1]
4241
if(default_deconstruction_screwdriver(user, icon_state, icon_state, I))
43-
change_pipe_connection(!anchored)
4442
return
4543
if(panel_open)
4644
if(default_unfasten_wrench(user, I, 10))
4745
dump_gas()
4846
return
4947
else
50-
to_chat(user, span_warning("[panel_open? "Too much gas inside, make sure it's below 1000 moles!" : "Open the panel first!"]"))
48+
to_chat(user, span_warning("Open the panel first!"))
5149
return
5250
return ..()
5351

5452
/obj/machinery/atmospherics/components/unary/tank/attackby_secondary(obj/item/I, mob/user, params)
5553
if(panel_open)
5654
if(default_change_direction_wrench(user, I))
55+
change_pipe_connection(TRUE, TRUE)
5756
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
5857
else
5958
return SECONDARY_ATTACK_CALL_NORMAL
@@ -113,48 +112,44 @@
113112
greyscale_config = null
114113
greyscale_colors = null
115114

116-
/obj/machinery/atmospherics/components/unary/tank/air/Initialize(mapload)
115+
/obj/machinery/atmospherics/components/unary/tank/air/New()
117116
. = ..()
118117
var/datum/gas_mixture/air_contents = airs[1]
119118
air_contents.set_moles(GAS_O2, AIR_CONTENTS * 0.2)
120119
air_contents.set_moles(GAS_N2, AIR_CONTENTS * 0.8)
121120

122121
/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide
123-
name = "pressure tank (CO2)"
124122
gas_type = GAS_CO2
125123
greyscale_colors = "#2f2f38"
126124

127-
/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide/Initialize(mapload)
125+
/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide/New()
128126
. = ..()
129127
var/datum/gas_mixture/air_contents = airs[1]
130128
air_contents.set_moles(GAS_CO2, AIR_CONTENTS)
131129

132130
/obj/machinery/atmospherics/components/unary/tank/plasma
133-
name = "pressure tank (Plasma)"
134131
gas_type = GAS_PLASMA
135132
greyscale_colors = "#f05f16"
136133

137-
/obj/machinery/atmospherics/components/unary/tank/plasma/Initialize(mapload)
134+
/obj/machinery/atmospherics/components/unary/tank/plasma/New()
138135
. = ..()
139136
var/datum/gas_mixture/air_contents = airs[1]
140137
air_contents.set_moles(GAS_PLASMA, AIR_CONTENTS)
141138

142139
/obj/machinery/atmospherics/components/unary/tank/oxygen
143-
name = "pressure tank (O2)"
144140
gas_type = GAS_O2
145141
greyscale_colors = "#148df4"
146142

147-
/obj/machinery/atmospherics/components/unary/tank/oxygen/Initialize(mapload)
143+
/obj/machinery/atmospherics/components/unary/tank/oxygen/New()
148144
. = ..()
149145
var/datum/gas_mixture/air_contents = airs[1]
150146
air_contents.set_moles(GAS_O2, AIR_CONTENTS)
151147

152148
/obj/machinery/atmospherics/components/unary/tank/nitrogen
153-
name = "pressure tank (N2)"
154149
gas_type = GAS_N2
155150
greyscale_colors = "#2d8f44"
156151

157-
/obj/machinery/atmospherics/components/unary/tank/nitrogen/Initialize(mapload)
152+
/obj/machinery/atmospherics/components/unary/tank/nitrogen/New()
158153
. = ..()
159154
var/datum/gas_mixture/air_contents = airs[1]
160155
air_contents.set_moles(GAS_N2, AIR_CONTENTS)

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
uid = num2text(gl_uid++)
2727
return uid
2828

29-
/obj/machinery/atmospherics/components/unary/proc/change_pipe_connection(disconnect)
29+
/obj/machinery/atmospherics/components/unary/proc/change_pipe_connection(disconnect, reconnect=FALSE)
3030
if(disconnect)
3131
disconnect_pipes()
32-
return
32+
if(!reconnect)
33+
return
3334
connect_pipes()
3435

3536
/obj/machinery/atmospherics/components/unary/proc/connect_pipes()

0 commit comments

Comments
 (0)