mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-05 07:13:51 +01:00
make mobs predict jumps before even getting too close to a bock.
This commit is contained in:
parent
44ba08cb8b
commit
f242655b13
@ -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 New Issue
Block a user