mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-11 02:10:20 +01:00
tweak riding functions
This commit is contained in:
parent
0e72f0ca81
commit
7b429df9e9
4
api.lua
4
api.lua
@ -28,7 +28,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20220314",
|
version = "20220421",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -1054,7 +1054,7 @@ end
|
|||||||
-- is mob facing a cliff
|
-- is mob facing a cliff
|
||||||
function mob_class:is_at_cliff()
|
function mob_class:is_at_cliff()
|
||||||
|
|
||||||
if self.fear_height == 0 then -- 0 for no falling protection!
|
if self.driver or self.fear_height == 0 then -- 0 for no falling protection!
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||||||
|
|
||||||
elseif velo.y > 0 then
|
elseif velo.y > 0 then
|
||||||
|
|
||||||
velo.y = velo.y - 0.1
|
velo.y = velo.y - dtime
|
||||||
|
|
||||||
if velo.y < 0 then velo.y = 0 end
|
if velo.y < 0 then velo.y = 0 end
|
||||||
end
|
end
|
||||||
@ -310,7 +310,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||||||
|
|
||||||
elseif velo.y < 0 then
|
elseif velo.y < 0 then
|
||||||
|
|
||||||
velo.y = velo.y + 0.1
|
velo.y = velo.y + dtime
|
||||||
|
|
||||||
if velo.y > 0 then velo.y = 0 end
|
if velo.y > 0 then velo.y = 0 end
|
||||||
end
|
end
|
||||||
@ -366,7 +366,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
|||||||
|
|
||||||
if not p then return end
|
if not p then return end
|
||||||
|
|
||||||
local new_acce = {x = 0, y = -9.81, z = 0}
|
local new_acce = {x = 0, y = entity.fall_speed, z = 0}
|
||||||
|
|
||||||
p.y = p.y - 0.5
|
p.y = p.y - 0.5
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user