gas miners only update overlays when they actually need to
This commit is contained in:
@@ -29,6 +29,10 @@
|
||||
idle_power_usage = 150
|
||||
active_power_usage = 2000
|
||||
|
||||
/obj/machinery/atmospherics/miner/Initialize()
|
||||
. = ..()
|
||||
set_active(active) //Force overlay update.
|
||||
|
||||
/obj/machinery/atmospherics/miner/examine(mob/user)
|
||||
..()
|
||||
if(broken)
|
||||
@@ -40,31 +44,41 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(!isopenturf(T))
|
||||
broken_message = "<span class='boldnotice'>VENT BLOCKED</span>"
|
||||
broken = TRUE
|
||||
set_broken(TRUE)
|
||||
return FALSE
|
||||
var/turf/open/OT = T
|
||||
if(OT.planetary_atmos)
|
||||
broken_message = "<span class='boldwarning'>DEVICE NOT ENCLOSED IN A PRESSURIZED ENVIRONMENT</span>"
|
||||
broken = TRUE
|
||||
set_broken(TRUE)
|
||||
return FALSE
|
||||
if(isspaceturf(T))
|
||||
broken_message = "<span class='boldnotice'>AIR VENTING TO SPACE</span>"
|
||||
broken = TRUE
|
||||
set_broken(TRUE)
|
||||
return FALSE
|
||||
var/datum/gas_mixture/G = OT.return_air()
|
||||
if(G.return_pressure() > (max_ext_kpa - ((spawn_mol*spawn_temp*R_IDEAL_GAS_EQUATION)/(CELL_VOLUME))))
|
||||
broken_message = "<span class='boldwarning'>EXTERNAL PRESSURE OVER THRESHOLD</span>"
|
||||
broken = TRUE
|
||||
set_broken(TRUE)
|
||||
return FALSE
|
||||
if(G.total_moles() > max_ext_mol)
|
||||
broken_message = "<span class='boldwarning'>EXTERNAL AIR CONCENTRATION OVER THRESHOLD</span>"
|
||||
broken = TRUE
|
||||
set_broken(TRUE)
|
||||
return FALSE
|
||||
if(broken)
|
||||
broken = FALSE
|
||||
set_broken(FALSE)
|
||||
broken_message = ""
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/miner/proc/set_active(setting)
|
||||
if(active != setting)
|
||||
active = setting
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/miner/proc/set_broken(setting)
|
||||
if(broken != setting)
|
||||
broken = setting
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/miner/proc/update_power()
|
||||
if(!active)
|
||||
active_power_usage = idle_power_usage
|
||||
@@ -96,7 +110,7 @@
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/miner/update_icon()
|
||||
overlays.Cut()
|
||||
cut_overlays()
|
||||
if(broken)
|
||||
add_overlay("broken")
|
||||
else if(active)
|
||||
@@ -106,7 +120,6 @@
|
||||
|
||||
/obj/machinery/atmospherics/miner/process()
|
||||
update_power()
|
||||
update_icon()
|
||||
check_operation()
|
||||
if(active && !broken)
|
||||
if(isnull(spawn_id))
|
||||
|
||||
Reference in New Issue
Block a user