From 01e08cbb30085800c600c4501a3763b053dea85a Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sat, 9 Sep 2017 21:55:17 +0200 Subject: [PATCH] player bugfix --- init.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 643a4d6..bfdfc83 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ Tower Crane Mod =============== - v0.10 by JoSt + v0.11 by JoSt Copyright (C) 2017 Joachim Stolberg LGPLv2.1+ @@ -20,6 +20,7 @@ 2017-07-16 v0.08 player times out bugfix 2017-08-19 v0.09 crane protection area to prevent crane clusters 2017-08-27 v0.10 hook instance and sound switch off bug fixes + 2017-09-09 v0.11 further player bugfixes ]]-- @@ -346,12 +347,14 @@ local function remove_hook(player, pos, y_offs) pos = table.copy(pos) pos.y = pos.y + y_offs local key = minetest.hash_node_position(pos) - default.player_set_animation(player, "stand" , 10) + if player ~= nil then + default.player_set_animation(player, "stand" , 10) + end local hook = towercrane.hook[key] if hook then -- remove hook hook:remove() - if hook:get_luaentity().sound ~= nil then + if hook and hook:get_luaentity() and hook:get_luaentity().sound ~= nil then -- stop sound minetest.sound_stop(hook:get_luaentity().sound) end