0067c5d18d
Before, ABM firing was delayed by up to a full interval, but the fulfillment timer could wander around relative to the trigger, which could lead to unreliable door ablation. Instead, just always run the ABM fulfilment triggers on the next tick, so limted_abm is ONLY doing the limiting for events that arrive within the same tick, as most ABMs do.
20 lines
609 B
Lua
20 lines
609 B
Lua
-- LUALOCALS < ---------------------------------------------------------
|
|
local minetest, nodecore, vector
|
|
= minetest, nodecore, vector
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
nodecore.register_limited_abm({
|
|
label = "Door Laser Ablation",
|
|
interval = 2,
|
|
chance = 1,
|
|
nodenames = {"nc_optics:lens_on"},
|
|
action = function(pos, node)
|
|
local face = nodecore.facedirs[node.param2]
|
|
local out = vector.add(face.k, pos)
|
|
local tn = minetest.get_node(out)
|
|
if nodecore.operate_door(out, tn, face.k) then
|
|
nodecore.witness(pos, "door ablation")
|
|
end
|
|
end
|
|
})
|