mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 09:31:07 +01:00
make mobs predict jumps before even getting too close to a bock.
This commit is contained in:
parent
44ba08cb8b
commit
f242655b13
1 changed files with 9 additions and 2 deletions
|
@ -1409,9 +1409,16 @@ local do_jump = function(self)
|
|||
return false
|
||||
end
|
||||
|
||||
local v = self.object:get_velocity()
|
||||
local v2 = abs(v.x)+abs(v.z)*.833
|
||||
local jump_c_multiplier = 1
|
||||
if v2/self.walk_velocity/2>1 then
|
||||
jump_c_multiplier = v2/self.walk_velocity/2
|
||||
end
|
||||
|
||||
-- where is front
|
||||
local dir_x = -sin(yaw) * (self.collisionbox[4] + 0.5)
|
||||
local dir_z = cos(yaw) * (self.collisionbox[4] + 0.5)
|
||||
local dir_x = -sin(yaw) * (self.collisionbox[4] + 0.5)*jump_c_multiplier+.4
|
||||
local dir_z = cos(yaw) * (self.collisionbox[4] + 0.5)*jump_c_multiplier+.4
|
||||
|
||||
-- what is in front of mob?
|
||||
nod = node_ok({
|
||||
|
|
Loading…
Reference in a new issue