From 819d211b230adc769fcb29e3a59e36afb814a806 Mon Sep 17 00:00:00 2001 From: Heroman Date: Wed, 28 Aug 2019 18:21:52 +1000 Subject: [PATCH] Fixes power not updating when shuttle moves --- code/game/area/areas_vr.dm | 6 ++++++ code/game/machinery/telecomms/presets_vr.dm | 3 +++ code/modules/power/apc_vr.dm | 9 +++++++++ vorestation.dme | 2 ++ 4 files changed, 20 insertions(+) create mode 100644 code/game/area/areas_vr.dm create mode 100644 code/modules/power/apc_vr.dm diff --git a/code/game/area/areas_vr.dm b/code/game/area/areas_vr.dm new file mode 100644 index 00000000000..d422c1cd0f1 --- /dev/null +++ b/code/game/area/areas_vr.dm @@ -0,0 +1,6 @@ +/area/shuttle_arrived() + .=..() + for(var/obj/machinery/telecomms/relay/R in contents) + R.reset_z() + for(var/obj/machinery/power/apc/A in contents) + A.update_area() diff --git a/code/game/machinery/telecomms/presets_vr.dm b/code/game/machinery/telecomms/presets_vr.dm index 1bd6b92460d..01a07a5f5ed 100644 --- a/code/game/machinery/telecomms/presets_vr.dm +++ b/code/game/machinery/telecomms/presets_vr.dm @@ -3,3 +3,6 @@ hide = 1 produces_heat = 0 autolinkers = list("hb_relay") + +/obj/machinery/telecomms/relay/proc/reset_z() + listening_level = z diff --git a/code/modules/power/apc_vr.dm b/code/modules/power/apc_vr.dm new file mode 100644 index 00000000000..c08c9b8db04 --- /dev/null +++ b/code/modules/power/apc_vr.dm @@ -0,0 +1,9 @@ +/obj/machinery/power/apc/proc/update_area() + var/area/NA = get_area(src) + if(!(NA == area)) + if(area.apc == src) + area.apc = null + NA.apc = src + area = NA + name = "[area.name] APC" + update() \ No newline at end of file diff --git a/vorestation.dme b/vorestation.dme index e68f4c096ae..a12fd398043 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -483,6 +483,7 @@ #include "code\game\antagonist\station\traitor.dm" #include "code\game\area\ai_monitored.dm" #include "code\game\area\areas.dm" +#include "code\game\area\areas_vr.dm" #include "code\game\area\asteroid_areas.dm" #include "code\game\area\Away Mission areas.dm" #include "code\game\area\Space Station 13 areas.dm" @@ -2679,6 +2680,7 @@ #include "code\modules\planet\time.dm" #include "code\modules\planet\weather.dm" #include "code\modules\power\apc.dm" +#include "code\modules\power\apc_vr.dm" #include "code\modules\power\batteryrack.dm" #include "code\modules\power\breaker_box.dm" #include "code\modules\power\cable.dm"