mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-18 00:51:06 +01:00
Clean up is_as_cliff code and convert to new style vector part 2
This commit is contained in:
parent
31e6e38013
commit
09619a62ee
1 changed files with 3 additions and 2 deletions
|
@ -219,8 +219,9 @@ function mob_class:is_at_cliff_or_danger(can_jump_cliff)
|
|||
local ypos = pos.y + self.collisionbox[2] -- just above floor
|
||||
|
||||
local free_fall, blocker = minetest.line_of_sight(
|
||||
{x = pos.x + dir_x, y = ypos, z = pos.z + dir_z},
|
||||
{x = pos.x + dir_x, y = ypos - self.fear_height, z = pos.z + dir_z})
|
||||
vector.new(pos.x + dir_x, ypos, pos.z + dir_z),
|
||||
vector.new(pos.x + dir_x, ypos - self.fear_height, pos.z + dir_z))
|
||||
|
||||
if free_fall then
|
||||
return true
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue