mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 04:21:07 +01:00
Merge pull request 'Fix crash when getting attacked by mob while in boat' (#2778) from fix_boat_mob_crash into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2778
This commit is contained in:
commit
210496b615
1 changed files with 22 additions and 20 deletions
|
@ -3991,6 +3991,7 @@ local mob_step = function(self, dtime)
|
|||
if self._locked_object:is_player() then
|
||||
_locked_object_eye_height = self._locked_object:get_properties().eye_height
|
||||
end
|
||||
if _locked_object_eye_height then
|
||||
local self_rot = self.object:get_rotation()
|
||||
if self.object:get_attach() then
|
||||
self_rot = self.object:get_attach():get_rotation()
|
||||
|
@ -4014,6 +4015,7 @@ local mob_step = function(self, dtime)
|
|||
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, 0, -(((mob_yaw-oldr.y)*.3)+oldr.y)*3))
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif not self._locked_object and math.abs(oldr.y) > 3 and math.abs(oldr.x) < 3 then
|
||||
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.multiply(oldr, 0.9))
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue