Power monitoring consoles find all station-related sensors (#4853)

This commit is contained in:
Anewbe
2018-02-17 20:40:32 -08:00
committed by Atermonera
parent c359d8aae4
commit 09f7f798d3
+5 -1
View File
@@ -43,8 +43,12 @@
/datum/nano_module/power_monitor/proc/refresh_sensors()
grid_sensors = list()
var/turf/T = get_turf(nano_host())
var/list/levels = list()
if(T)
levels += using_map.get_map_levels(T.z, FALSE)
world << "levels"
for(var/obj/machinery/power/sensor/S in machines)
if((T && S.loc.z == T.z) || (S.long_range)) // Consoles have range on their Z-Level. Sensors with long_range var will work between Z levels.
if(T && (S.loc.z == T.z) || (S.loc.z in levels) || (S.long_range)) // Consoles have range on their Z-Level. Sensors with long_range var will work between Z levels.
if(S.name_tag == "#UNKN#") // Default name. Shouldn't happen!
warning("Powernet sensor with unset ID Tag! [S.x]X [S.y]Y [S.z]Z")
else