fix naming
This commit is contained in:
parent
f5f27ef999
commit
f651e407f7
@ -19,14 +19,14 @@ industrialtest.JetpackBase=table.copy(industrialtest.GearTool)
|
|||||||
industrialtest.internal.unpackTableInto(industrialtest.JetpackBase,{
|
industrialtest.internal.unpackTableInto(industrialtest.JetpackBase,{
|
||||||
part="torso"
|
part="torso"
|
||||||
})
|
})
|
||||||
local sound_handles = {}
|
local soundHandles = {}
|
||||||
|
|
||||||
function industrialtest.JetpackBase.update(self, player, inv, itemstack, dtime)
|
function industrialtest.JetpackBase.update(self, player, inv, itemstack, dtime)
|
||||||
local playerName = player:get_player_name()
|
local playerName = player:get_player_name()
|
||||||
local control = player:get_player_control()
|
local control = player:get_player_control()
|
||||||
if control.jump and self:tryFly(itemstack) then
|
if control.jump and self:tryFly(itemstack) then
|
||||||
self.addYVelocityClamped(player,1,10)
|
self.addYVelocityClamped(player,1,10)
|
||||||
if not sound_handles[playerName] then
|
if not soundHandles[playerName] then
|
||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
local handle = minetest.sound_play("industrialtest_jetpack_loop", {
|
local handle = minetest.sound_play("industrialtest_jetpack_loop", {
|
||||||
pos = pos,
|
pos = pos,
|
||||||
@ -35,13 +35,13 @@ function industrialtest.JetpackBase.update(self, player, inv, itemstack, dtime)
|
|||||||
object = player, -- Attach the sound to the player
|
object = player, -- Attach the sound to the player
|
||||||
loop = true, -- The sound is played in a loop
|
loop = true, -- The sound is played in a loop
|
||||||
})
|
})
|
||||||
sound_handles[playerName] = handle
|
soundHandles[playerName] = handle
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
if sound_handles[playerName] then
|
if soundHandles[playerName] then
|
||||||
minetest.sound_stop(sound_handles[playerName])
|
minetest.sound_stop(soundHandles[playerName])
|
||||||
sound_handles[playerName] = nil
|
soundHandles[playerName] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user