Fix minor bug that caused machines to assume wrong power state at times

This commit is contained in:
Zenon Seth 2024-03-17 14:47:38 +00:00
parent 80ba7d61c4
commit f7e7b4ba49

View File

@ -97,8 +97,8 @@ function logistica.toggle_machine_on_off(pos)
local newState = (meta:get_int(META_ON_OFF_KEY) + 1) % 2
local def = minetest.registered_nodes[node.name]
if def and def.logistica and def.logistica.on_power then
def.logistica.on_power(pos, newState > 0)
meta:set_int(META_ON_OFF_KEY, newState)
def.logistica.on_power(pos, newState > 0)
return newState > 0
end
return nil