replace deprecated functions, fix falling node torch bombs
This commit is contained in:
parent
aa23584c01
commit
0c4c691c8d
10
init.lua
10
init.lua
@ -462,6 +462,7 @@ local function register_torch_bomb(name, desc, dirs, min_range, blast_radius, te
|
||||
minetest.sound_play("tnt_ignite", {pos = pos})
|
||||
end
|
||||
minetest.get_node_timer(pos):start(3)
|
||||
minetest.check_for_falling(pos)
|
||||
end,
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
@ -619,6 +620,7 @@ local function register_torch_bomb(name, desc, dirs, min_range, blast_radius, te
|
||||
minetest.sound_play("tnt_ignite", {pos = pos})
|
||||
end
|
||||
minetest.get_node_timer(pos):start(3)
|
||||
minetest.check_for_falling(pos)
|
||||
end,
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
@ -628,7 +630,7 @@ local function register_torch_bomb(name, desc, dirs, min_range, blast_radius, te
|
||||
minetest.set_node(pos, {name="air"})
|
||||
|
||||
local obj = minetest.add_entity(pos, "torch_bomb:"..name.."_rocket_entity")
|
||||
obj:setacceleration({x=0, y=1, z=0})
|
||||
obj:set_acceleration({x=0, y=1, z=0})
|
||||
local lua_entity = obj:get_luaentity()
|
||||
lua_entity.player_name = ignitor_name
|
||||
lua_entity.fuse = fuse
|
||||
@ -659,9 +661,9 @@ if enable_grenade then
|
||||
local player_pos = user:get_pos()
|
||||
local obj = minetest.add_entity({x = player_pos.x, y = player_pos.y + 1.5, z = player_pos.z}, "torch_bomb:torch_grenade_entity")
|
||||
local dir = user:get_look_dir()
|
||||
obj:setvelocity(vector.multiply(dir, throw_velocity))
|
||||
obj:setacceleration(gravity)
|
||||
obj:setyaw(user:get_look_yaw()+math.pi)
|
||||
obj:set_velocity(vector.multiply(dir, throw_velocity))
|
||||
obj:set_acceleration(gravity)
|
||||
obj:set_yaw(user:get_look_horizontal()+math.pi)
|
||||
local lua_entity = obj:get_luaentity()
|
||||
lua_entity.player_name = user:get_player_name()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user