mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Fixes cell-less APC causing TGUI BSOD on Power Monitor (#15196)
* Fixes cell-less APC causing TGUI BSOD on Power Monitor * Clean code ™
This commit is contained in:
Vendored
+9
-1
@@ -21,7 +21,15 @@ GLOBAL_DATUM_INIT(apc_repository, /datum/repository/apc, new())
|
||||
var/list/Status = list("Off","AOff","On","AOn") // Status: off, auto-off, on, auto-on
|
||||
var/list/chg = list("N","C","F") // Charging: no, charging, full
|
||||
for(var/obj/machinery/power/apc/A in L)
|
||||
apcData[++apcData.len] = list("Name" = html_encode(A.area.name), "Equipment" = Status[A.equipment+1], "Lights" = Status[A.lighting+1], "Environment" = Status[A.environ+1], "CellPct" = A.cell ? round(A.cell.percent(),1) : "M", "CellStatus" = A.cell ? chg[A.charging+1] : "M", "Load" = round(A.lastused_total,1))
|
||||
apcData[++apcData.len] = list(
|
||||
"Name" = html_encode(A.area.name),
|
||||
"Equipment" = Status[A.equipment + 1],
|
||||
"Lights" = Status[A.lighting + 1],
|
||||
"Environment" = Status[A.environ + 1],
|
||||
"CellPct" = A.cell ? round(A.cell.percent(), 1) : 0,
|
||||
"CellStatus" = A.cell ? chg[A.charging + 1] : "M",
|
||||
"Load" = round(A.lastused_total, 1)
|
||||
)
|
||||
|
||||
cache_entry.timestamp = world.time + 5 SECONDS
|
||||
cache_entry.data = apcData
|
||||
|
||||
Reference in New Issue
Block a user