From 6dc64c7050c410e0979e520bbbd6b60ba46fb485 Mon Sep 17 00:00:00 2001 From: cheapie Date: Thu, 30 Aug 2018 18:13:59 -0500 Subject: Add remote strobe and old-fashioned horn/light plate --- firealarm_panel/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'firealarm_panel') diff --git a/firealarm_panel/init.lua b/firealarm_panel/init.lua index 28955ab..7adc1ea 100644 --- a/firealarm_panel/init.lua +++ b/firealarm_panel/init.lua @@ -261,6 +261,7 @@ minetest.register_node(":firealarm:panel",{ firealarm.setDevInfo("panel",pos,{ associatedSignalingDevices = {}, associatedNotificationDevices = {}, + associatedAnnunciators = {}, removeMenuDevList = {}, alarm = {}, supervisory = {}, @@ -533,6 +534,7 @@ function firealarm.panelABM(pos) local node = minetest.get_node(pos) local devInfo = firealarm.getDevInfo("panel",pos) if not devInfo then return end + if not devInfo.associatedAnnunciators then devInfo.associatedAnnunciators = {} end local hornsActive = #devInfo.alarm > 0 and not devInfo.silenced local strobesActive = #devInfo.alarm > 0 for i in pairs(devInfo.associatedNotificationDevices) do @@ -560,6 +562,12 @@ function firealarm.panelABM(pos) end end end + for i,v in pairs(devInfo.associatedAnnunciators) do + local dev = firealarm.getDevInfo("annunciator",minetest.get_position_from_hash(i)) + if not dev then + trouble(pos,minetest.get_position_from_hash(i)) + end + end local currentName = node.name local newName = "firealarm:panel" if #devInfo.alarm > 0 then newName = newName.."_alarm" end -- cgit v1.2.3