mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Merge pull request 'make mob constant for velocity rotate with mob.' (#2855) from fix_runaway_mobs_sliding into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2855 Reviewed-by: cora <cora@noreply.git.minetest.land>
This commit is contained in:
commit
8b566cddf3
1 changed files with 6 additions and 0 deletions
|
@ -443,8 +443,14 @@ local set_yaw = function(self, yaw, delay, dtime)
|
|||
if math.abs(target_shortest_path) > 280*ddtime then
|
||||
if target_shortest_path > 0 then
|
||||
self.object:set_yaw(self.object:get_yaw()+3.6*ddtime)
|
||||
if self.acc then
|
||||
self.acc=vector.rotate_around_axis(self.acc,vector.new(0,1,0), 3.6*ddtime)
|
||||
end
|
||||
else
|
||||
self.object:set_yaw(self.object:get_yaw()-3.6*ddtime)
|
||||
if self.acc then
|
||||
self.acc=vector.rotate_around_axis(self.acc,vector.new(0,1,0), -3.6*ddtime)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue