1
0
mirror of https://github.com/mt-mods/pipeworks.git synced 2025-06-28 06:20:29 +02:00

refactor pressure logic toggle to act as option enum

This commit is contained in:
thetaepsilon-gamedev
2017-10-20 22:46:51 +01:00
parent 538e33c537
commit 75978a0207
5 changed files with 17 additions and 15 deletions

View File

@ -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 },

View File

@ -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