forked from MineClone5/MineClone5
#55 Rewrite boat get_visual_size in a bit safer way
This commit is contained in:
parent
315ed0e72c
commit
e7e8d394ed
|
@ -41,7 +41,14 @@ local function check_object(obj)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_visual_size(obj)
|
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
|
end
|
||||||
|
|
||||||
local function set_attach(boat)
|
local function set_attach(boat)
|
||||||
|
|
Loading…
Reference in New Issue