summaryrefslogtreecommitdiff
path: root/dispatcher.lua
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2025-04-27 00:41:25 -0500
committercheapie <no-email-for-you@example.com>2025-04-27 00:41:25 -0500
commit8b721c04e0cacefe7bd6402f1c00406b303a1d70 (patch)
tree3e2b7b8ac50465f1b03a62aafb08e72b53cbc13f /dispatcher.lua
parent9a06e6564cc1e0ac0f70eb19b0491ba1f00ea0eb (diff)
downloadcelevator-8b721c04e0cacefe7bd6402f1c00406b303a1d70.tar
celevator-8b721c04e0cacefe7bd6402f1c00406b303a1d70.tar.gz
celevator-8b721c04e0cacefe7bd6402f1c00406b303a1d70.tar.bz2
celevator-8b721c04e0cacefe7bd6402f1c00406b303a1d70.tar.xz
celevator-8b721c04e0cacefe7bd6402f1c00406b303a1d70.zip
Minor controller/dispatcher performance improvementsHEADmain
Diffstat (limited to 'dispatcher.lua')
-rw-r--r--dispatcher.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/dispatcher.lua b/dispatcher.lua
index a8bcf1c..02533ff 100644
--- a/dispatcher.lua
+++ b/dispatcher.lua
@@ -422,7 +422,9 @@ end
function celevator.dispatcher.checkiqueue(dtime)
for hash,iqueue in pairs(celevator.dispatcher.iqueue) do
local pos = minetest.get_position_from_hash(hash)
+ local noneleft = true
for iid,time in pairs(iqueue) do
+ noneleft = false
iqueue[iid] = time-dtime
if iqueue[iid] < 0 then
iqueue[iid] = nil
@@ -432,6 +434,10 @@ function celevator.dispatcher.checkiqueue(dtime)
celevator.dispatcher.run(pos,event)
end
end
+ if noneleft then
+ celevator.dispatcher.iqueue[hash] = nil
+ celevator.storage:set_string("dispatcher_iqueue",minetest.serialize(celevator.dispatcher.iqueue))
+ end
end
end