From 1669cfd4510a2dbb2ca3c754b414ae8c976ceca1 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Sat, 7 Oct 2017 15:42:00 +0100 Subject: [PATCH] new flow logic: flowable_node_registry_install.lua: add duplicate registration guard for register.output() --- new_flow_logic/flowable_node_registry_install.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/new_flow_logic/flowable_node_registry_install.lua b/new_flow_logic/flowable_node_registry_install.lua index 650d1da..07001ef 100644 --- a/new_flow_logic/flowable_node_registry_install.lua +++ b/new_flow_logic/flowable_node_registry_install.lua @@ -71,6 +71,9 @@ end -- if finite mode is on, upper is ignored and lower is used to determine whether to run outputfn; -- cleanupfn is ignored in this mode as finite mode assumes something causes water to move itself. register.output = function(nodename, upper, lower, outputfn) + if pipeworks.flowables.outputs.list[nodename] then + error("pipeworks.flowables.outputs duplicate registration!") + end checkbase(nodename) pipeworks.flowables.outputs.list[nodename] = { threshold=threshold, outputfn=outputfn } if pipeworks.toggles.pressure_logic then