mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 22:33:16 -04:00
Now it actually works fine
This commit is contained in:
parent
1de58d0011
commit
b83153897c
1 changed files with 3 additions and 2 deletions
|
@ -27,6 +27,7 @@ function player_api.register_model(name, def)
|
||||||
def.collisionbox = def.collisionbox or {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}
|
def.collisionbox = def.collisionbox or {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}
|
||||||
def.stepheight = def.stepheight or 0.6
|
def.stepheight = def.stepheight or 0.6
|
||||||
def.eye_height = def.eye_height or 1.47
|
def.eye_height = def.eye_height or 1.47
|
||||||
|
|
||||||
-- Sort animations into property classes:
|
-- Sort animations into property classes:
|
||||||
-- Animations with same properties have the same _equals value
|
-- Animations with same properties have the same _equals value
|
||||||
for animation_name, animation in pairs(def.animations) do
|
for animation_name, animation in pairs(def.animations) do
|
||||||
|
@ -131,7 +132,7 @@ function player_api.set_animation(player, anim_name, speed)
|
||||||
player_data.animation = anim_name
|
player_data.animation = anim_name
|
||||||
player_data.animation_speed = speed
|
player_data.animation_speed = speed
|
||||||
player:set_animation(anim, speed, animation_blend)
|
player:set_animation(anim, speed, animation_blend)
|
||||||
if anim._equals == previous_anim_equals then
|
if anim._equals ~= previous_anim_equals then
|
||||||
player:set_properties({
|
player:set_properties({
|
||||||
collisionbox = anim.collisionbox,
|
collisionbox = anim.collisionbox,
|
||||||
eye_height = anim.eye_height
|
eye_height = anim.eye_height
|
||||||
|
@ -207,4 +208,4 @@ for _, api_function in pairs({"get_animation", "set_animation", "set_model", "se
|
||||||
end
|
end
|
||||||
original_function(player, ...)
|
original_function(player, ...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue