Refactor jetpacks

This commit is contained in:
2025-04-17 13:49:06 +02:00
parent b383231c40
commit 000cff6940
5 changed files with 81 additions and 135 deletions

View File

@@ -48,14 +48,7 @@ function industrialtest.GearTool.register(self)
end
end
local updateDelta=0
minetest.register_globalstep(function(dtime)
updateDelta=updateDelta+dtime
if updateDelta<industrialtest.updateDelay then
return
end
updateDelta=0
local players=minetest.get_connected_players()
for _,player in ipairs(players) do
local inv
@@ -70,7 +63,7 @@ minetest.register_globalstep(function(dtime)
for i,itemstack in ipairs(armorList) do
local def=itemstack:get_definition()
if def and def.groups._industrialtest_gearTool and def._industrialtest_self and def._industrialtest_self.update and
def._industrialtest_self:update(player,itemstack) then
def._industrialtest_self:update(player,itemstack,dtime) then
inv:set_stack("armor",i,itemstack)
end
end