#55 Rewrite boat get_visual_size in a bit safer way

This commit is contained in:
kay27 2021-12-25 04:49:12 +04:00
parent 315ed0e72c
commit e7e8d394ed
1 changed files with 8 additions and 1 deletions

View File

@ -41,7 +41,14 @@ local function check_object(obj)
end
local function get_visual_size(obj)
return obj:is_player() and {x = 1, y = 1, z = 1} or obj:get_luaentity()._old_visual_size or obj:get_properties().visual_size
if not obj or obj:is_player() then
return boat_visual_size
end
local luaentity = obj:get_luaentity()
if luaentity then
return luaentity._old_visual_size
end
return obj:get_properties().visual_size
end
local function set_attach(boat)