summaryrefslogtreecommitdiff
path: root/pressure_logic
diff options
context:
space:
mode:
authorthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-10-20 22:46:51 +0100
committerthetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com>2017-10-20 22:46:51 +0100
commit75978a020751ce5591d0fd0b8adeaa32422b2fe5 (patch)
treeb1ab231598b02f7342c95ded253c8f671c9b1bd1 /pressure_logic
parent538e33c537c2c6347a7a2251392fedbf5ee07ba3 (diff)
downloadpipeworks-75978a020751ce5591d0fd0b8adeaa32422b2fe5.tar
pipeworks-75978a020751ce5591d0fd0b8adeaa32422b2fe5.tar.gz
pipeworks-75978a020751ce5591d0fd0b8adeaa32422b2fe5.tar.bz2
pipeworks-75978a020751ce5591d0fd0b8adeaa32422b2fe5.tar.xz
pipeworks-75978a020751ce5591d0fd0b8adeaa32422b2fe5.zip
refactor pressure logic toggle to act as option enum
Diffstat (limited to 'pressure_logic')
-rw-r--r--pressure_logic/abm_register.lua2
-rw-r--r--pressure_logic/flowable_node_registry_install.lua4
2 files changed, 3 insertions, 3 deletions
diff --git a/pressure_logic/abm_register.lua b/pressure_logic/abm_register.lua
index a8e3abc..4019eef 100644
--- a/pressure_logic/abm_register.lua
+++ b/pressure_logic/abm_register.lua
@@ -10,7 +10,7 @@ local flowlogic = pipeworks.flowlogic
-- see flowlogic.run() in abms.lua.
local register_flowlogic_abm = function(nodename)
- if pipeworks.toggles.pressure_logic then
+ if pipeworks.toggles.pipe_mode == "pressure" then
minetest.register_abm({
label = "pipeworks new_flow_logic run",
nodenames = { nodename },
diff --git a/pressure_logic/flowable_node_registry_install.lua b/pressure_logic/flowable_node_registry_install.lua
index 9bb9e9a..5cf1941 100644
--- a/pressure_logic/flowable_node_registry_install.lua
+++ b/pressure_logic/flowable_node_registry_install.lua
@@ -20,14 +20,14 @@ local insertbase = function(nodename)
if checkexists(nodename) then error("pipeworks.flowables duplicate registration!") end
pipeworks.flowables.list.all[nodename] = true
-- table.insert(pipeworks.flowables.list.nodenames, nodename)
- if pipeworks.toggles.pressure_logic then
+ if pipeworks.toggles.pipe_mode == "pressure" then
abmregister.flowlogic(nodename)
end
end
local regwarning = function(kind, nodename)
local tail = ""
- if not pipeworks.toggles.pressure_logic then tail = " but pressure logic not enabled" end
+ if pipeworks.toggles.pipe_mode ~= "pressure" then tail = " but pressure logic not enabled" end
--pipeworks.logger(kind.." flow logic registry requested for "..nodename..tail)
end