diff --git a/mods/ENTITIES/mcl_mobs/mount.lua b/mods/ENTITIES/mcl_mobs/mount.lua index b12c074da7..04050eb0e6 100644 --- a/mods/ENTITIES/mcl_mobs/mount.lua +++ b/mods/ENTITIES/mcl_mobs/mount.lua @@ -151,11 +151,12 @@ function mobs.attach(entity, player) } }) - minetest.after(0.2, function(player) - if player:is_player() then + minetest.after(0.2, function(name) + local player = minetest.get_player_by_name(name) + if player then mcl_player.player_set_animation(player, "sit" , 30) end - end, player) + end, player:get_player_name()) player:set_look_horizontal(entity.object:get_yaw() - rot_view) end @@ -171,11 +172,12 @@ function mobs.detach(player, offset) pos = {x = pos.x + offset.x, y = pos.y + 0.2 + offset.y, z = pos.z + offset.z} - minetest.after(0.1, function(player, pos) - if player:is_player() then + minetest.after(0.1, function(name, pos) + local player = minetest.get_player_by_name(name) + if player then player:set_pos(pos) end - end, player, pos) + end, player:get_player_name(), pos) end