Latest ball fixes revert, waiting for MT 5.4
This commit is contained in:
parent
77b69562a8
commit
87c4b493f8
@ -92,6 +92,7 @@ end)
|
||||
|
||||
|
||||
|
||||
--[[TODO: waiting for 5.4 to fix a few bugs
|
||||
arena_lib.on_quit("block_league", function(arena, p_name)
|
||||
if minetest.get_player_by_name(p_name):get_children()[1] then
|
||||
minetest.get_player_by_name(p_name):get_children()[1]:get_luaentity():detach()
|
||||
@ -102,6 +103,14 @@ end)
|
||||
|
||||
|
||||
|
||||
arena_lib.on_disconnect("block_league", function(arena, p_name)
|
||||
if minetest.get_player_by_name(p_name):get_children()[1] then
|
||||
minetest.get_player_by_name(p_name):get_children()[1]:get_luaentity():detach()
|
||||
end
|
||||
end)]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
@ -147,6 +147,7 @@ function ball:on_step(d_time, moveresult)
|
||||
return end
|
||||
|
||||
self:detach()
|
||||
self:oscillate()
|
||||
|
||||
return
|
||||
end
|
||||
@ -186,32 +187,20 @@ end
|
||||
|
||||
|
||||
|
||||
function ball:on_detach(parent)
|
||||
|
||||
self.wielder = parent
|
||||
self:detach()
|
||||
self:oscillate()
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
function ball:detach()
|
||||
|
||||
local player = self.wielder
|
||||
|
||||
announce_ball_possession_change(self.arena, player:get_player_name(), true)
|
||||
|
||||
if player then
|
||||
player:get_meta():set_int("bl_has_ball", 0)
|
||||
player:set_physics_override({
|
||||
speed = 0,
|
||||
jump = 0
|
||||
})
|
||||
|
||||
|
||||
self.object:set_detach()
|
||||
end
|
||||
|
||||
self.wielder = nil
|
||||
self.timer_bool = true
|
||||
self.timer = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user