forked from VoxeLibre/VoxeLibre
Merge pull request 'Fix crash when parrot sits on shoulder' (#3696) from fix_parrot_rotation_crash into master
Reviewed-on: MineClone2/MineClone2#3696
This commit is contained in:
commit
453e90741d
|
@ -348,7 +348,7 @@ function mob_class:check_head_swivel(dtime)
|
||||||
|
|
||||||
who_are_you_looking_at (self)
|
who_are_you_looking_at (self)
|
||||||
|
|
||||||
local final_rotation = vector.new(0,0,0)
|
local final_rotation = vector.zero()
|
||||||
local oldp,oldr = self.object:get_bone_position(self.head_swivel)
|
local oldp,oldr = self.object:get_bone_position(self.head_swivel)
|
||||||
|
|
||||||
if self._locked_object and (self._locked_object:is_player() or self._locked_object:get_luaentity()) and self._locked_object:get_hp() > 0 then
|
if self._locked_object and (self._locked_object:is_player() or self._locked_object:get_luaentity()) and self._locked_object:get_hp() > 0 then
|
||||||
|
@ -360,8 +360,11 @@ function mob_class:check_head_swivel(dtime)
|
||||||
_locked_object_eye_height = self._locked_object:get_properties().eye_height
|
_locked_object_eye_height = self._locked_object:get_properties().eye_height
|
||||||
end
|
end
|
||||||
if _locked_object_eye_height then
|
if _locked_object_eye_height then
|
||||||
|
|
||||||
local self_rot = self.object:get_rotation()
|
local self_rot = self.object:get_rotation()
|
||||||
if self.object:get_attach() then
|
-- If a mob is attached, should we really be messing with what they are looking at?
|
||||||
|
-- Should this be excluded?
|
||||||
|
if self.object:get_attach() and self.object:get_attach():get_rotation() then
|
||||||
self_rot = self.object:get_attach():get_rotation()
|
self_rot = self.object:get_attach():get_rotation()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue