Merge pull request #7009 from atlantiscze/2020_04_17_EPRFix

Fixes supermatter monitoring EPR indicator showing Undefined
This commit is contained in:
Atermonera
2020-04-22 12:46:47 -07:00
committed by VirgoBot
parent 3239a8e172
commit 1e4f5aa80e
2 changed files with 11 additions and 0 deletions

View File

@@ -77,6 +77,7 @@
data["SM_power"] = active.power
data["SM_ambienttemp"] = air.temperature
data["SM_ambientpressure"] = air.return_pressure()
data["SM_EPR"] = active.get_epr()
//data["SM_EPR"] = active.get_epr()
if(air.total_moles)
data["SM_gas_O2"] = round(100*air.gas["oxygen"]/air.total_moles,0.01)

View File

@@ -131,6 +131,16 @@
return SUPERMATTER_INACTIVE
/obj/machinery/power/supermatter/proc/get_epr()
var/turf/T = get_turf(src)
if(!istype(T))
return
var/datum/gas_mixture/air = T.return_air()
if(!air)
return 0
return round((air.total_moles / air.group_multiplier) / 23.1, 0.01)
/obj/machinery/power/supermatter/proc/explode()
message_admins("Supermatter exploded at ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("SUPERMATTER([x],[y],[z]) Exploded. Power:[power], Oxygen:[oxygen], Damage:[damage], Integrity:[get_integrity()]")