From ca6dee493eed4320321c9edd0b81a7e5667e1ea2 Mon Sep 17 00:00:00 2001 From: skull132 Date: Wed, 23 Nov 2016 22:47:22 +0200 Subject: [PATCH] Fix Mecha Runtimes (#1179) Consistently spammed these for 8+ hours today. No thank you. Remember kids, safety checking a variable before assuming it can be used is important. --- code/game/mecha/mecha.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 4dbc871cc98..7a4df64ac2f 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1452,7 +1452,7 @@ Powercell charge: [isnull(cell_charge)?"No powercell installed":"[cell.percent()]%"]
Air source: [use_internal_tank?"Internal Airtank":"Environment"]
Airtank pressure: [tank_pressure]kPa
- Airtank temperature: [tank_temperature]K|[tank_temperature - T0C]°C
+ Airtank temperature: [isnum(tank_temperature) ? "[tank_temperature]K|[tank_temperature - T0C]°C" : "Unknown"]
Cabin pressure: [cabin_pressure>WARNING_HIGH_PRESSURE ? "[cabin_pressure]": cabin_pressure]kPa
Cabin temperature: [return_temperature()]K|[return_temperature() - T0C]°C
Lights: [lights?"on":"off"]
@@ -1985,7 +1985,9 @@ process(var/obj/mecha/mecha) - if (!mecha) + // No cell will kill warnings. + // Makes sense, caution systems are battery powered. + if (!mecha || !mecha.cell) return if (!mecha.power_alert_status && mecha.cell)//If we're in the fine status