aboutsummaryrefslogtreecommitdiff
path: root/overrides.lua
diff options
context:
space:
mode:
authorBuckarooBanzay <BuckarooBanzay@users.noreply.github.com>2021-03-14 21:23:41 +0100
committerBuckarooBanzay <BuckarooBanzay@users.noreply.github.com>2021-03-14 21:23:41 +0100
commit8f5d9113040726456dc816f2a353cd6708d64d74 (patch)
tree7e25869a88b3deadd97743c8b9fb924812b9d42b /overrides.lua
parentfdb69489d823d3cb22f9757732245958f9734f3a (diff)
downloadmesecons_debug-8f5d9113040726456dc816f2a353cd6708d64d74.tar.gz
mesecons_debug-8f5d9113040726456dc816f2a353cd6708d64d74.zip
cleanup some of the tab/space mess
Diffstat (limited to '')
-rw-r--r--overrides.lua34
1 files changed, 17 insertions, 17 deletions
diff --git a/overrides.lua b/overrides.lua
index 55e480b..b50b6e5 100644
--- a/overrides.lua
+++ b/overrides.lua
@@ -2,35 +2,35 @@
-- execute()
local old_execute = mesecon.queue.execute
mesecon.queue.execute = function(self, action)
- if mesecons_debug.enabled then
- local t0 = minetest.get_us_time()
- old_execute(self, action)
- local t1 = minetest.get_us_time()
- local micros = t1 - t0
+ if mesecons_debug.enabled then
+ local t0 = minetest.get_us_time()
+ old_execute(self, action)
+ local t1 = minetest.get_us_time()
+ local micros = t1 - t0
- local ctx = mesecons_debug.get_context(action.pos)
- ctx.micros = ctx.micros + micros
- ctx.mtime = t0
+ local ctx = mesecons_debug.get_context(action.pos)
+ ctx.micros = ctx.micros + micros
+ ctx.mtime = t0
- --print("execute() func=" .. action.func .. " pos=" .. minetest.pos_to_string(action.pos) .. " micros=" .. micros)
- end
+ --print("execute() func=" .. action.func .. " pos=" .. minetest.pos_to_string(action.pos) .. " micros=" .. micros)
+ end
end
-- add_action()
local old_add_action = mesecon.queue.add_action
mesecon.queue.add_action = function(self, pos, func, params, time, overwritecheck, priority)
- if mesecons_debug.enabled then
- local ctx = mesecons_debug.get_context(pos)
+ if mesecons_debug.enabled then
+ local ctx = mesecons_debug.get_context(pos)
- time = time or 0
- time = time + ctx.penalty
+ time = time or 0
+ time = time + ctx.penalty
if time > mesecons_debug.penalty_mapblock_disabled then
-- penalty exceeded disable-threshold, don't even add the action
return
end
- old_add_action(self, pos, func, params, time, overwritecheck, priority)
- --print("add_action() pos=" .. minetest.pos_to_string(pos))
- end
+ old_add_action(self, pos, func, params, time, overwritecheck, priority)
+ --print("add_action() pos=" .. minetest.pos_to_string(pos))
+ end
end