diff options
Diffstat (limited to '')
-rw-r--r-- | overrides/mesecons_queue.lua | 17 | ||||
-rw-r--r-- | overrides/node_timers.lua | 1 |
2 files changed, 11 insertions, 7 deletions
diff --git a/overrides/mesecons_queue.lua b/overrides/mesecons_queue.lua index 4375d7d..d14b30c 100644 --- a/overrides/mesecons_queue.lua +++ b/overrides/mesecons_queue.lua @@ -1,8 +1,10 @@ local penalty_mapblock_disabled = mesecons_debug.settings.penalty_mapblock_disabled -mesecons_debug.settings._subscribe_for_modification("penalty_mapblock_disabled", - function(value) penalty_mapblock_disabled = value end) +mesecons_debug.settings._subscribe_for_modification("penalty_mapblock_disabled", function(value) + penalty_mapblock_disabled = value +end) + +local check_pos = mesecons_debug.check_pos --- execute() local old_execute = mesecon.queue.execute mesecon.queue.execute = function(self, action) if not mesecons_debug.enabled then @@ -11,6 +13,11 @@ mesecon.queue.execute = function(self, action) return end + if not check_pos(action.pos) then + mesecons_debug.log("error", "mesecons action has an invalid position and cannot be processed %s", dump(action)) + return + end + local ctx = mesecons_debug.get_context(action.pos) if ctx.whitelisted then return old_execute(self, action) @@ -22,18 +29,16 @@ mesecon.queue.execute = function(self, action) mesecons_debug.total_micros = mesecons_debug.total_micros + micros ctx.micros = ctx.micros + micros - ctx.mtime = t0 -- modification time + ctx.mtime = t0 -- modification time return rv end - -- add_action() local old_add_action = mesecon.queue.add_action mesecon.queue.add_action = function(self, pos, func, params, time, overwritecheck, priority) if not mesecons_debug.enabled then return old_add_action(self, pos, func, params, time, overwritecheck, priority) - elseif not mesecons_debug.mesecons_enabled then return end diff --git a/overrides/node_timers.lua b/overrides/node_timers.lua index ea37d6a..8f8043d 100644 --- a/overrides/node_timers.lua +++ b/overrides/node_timers.lua @@ -4,7 +4,6 @@ local function override_node_timer(node_name) on_timer = function(pos, elapsed) if not mesecons_debug.enabled then return old_node_timer(pos, elapsed) - elseif not mesecons_debug.mesecons_enabled then return true end |