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

@@ -20,7 +20,14 @@ industrialtest.internal.unpackTableInto(industrialtest.BatPackBase,{
part="torso"
})
function industrialtest.BatPackBase.update(self,player,itemstack)
local updateDelta=0
function industrialtest.BatPackBase.update(self,player,itemstack,dtime)
updateDelta=updateDelta+dtime
if updateDelta<industrialtest.updateDelay then
return false
end
updateDelta=0
local wielded=player:get_wielded_item()
local wieldedMeta=wielded:get_meta()
if not industrialtest.api.hasPowerStorage(wieldedMeta) or wieldedMeta:get_int("industrialtest.powerFlow")>self.flow then