Refactor jetpacks
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user