mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 22:22:25 +01:00
Enable player animation when Right Click (#2622)
This commit is contained in:
parent
7fc7fa4843
commit
7d230fdbf8
@ -106,7 +106,7 @@ function minetest.calculate_knockback(player, ...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Check each player and apply animations
|
-- Check each player and apply animations
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function()
|
||||||
for _, player in pairs(minetest.get_connected_players()) do
|
for _, player in pairs(minetest.get_connected_players()) do
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local model_name = player_model[name]
|
local model_name = player_model[name]
|
||||||
@ -134,13 +134,13 @@ minetest.register_globalstep(function(dtime)
|
|||||||
player_anim[name] = nil
|
player_anim[name] = nil
|
||||||
player_sneak[name] = controls.sneak
|
player_sneak[name] = controls.sneak
|
||||||
end
|
end
|
||||||
if controls.LMB then
|
if controls.LMB or controls.RMB then
|
||||||
player_set_animation(player, "walk_mine", animation_speed_mod)
|
player_set_animation(player, "walk_mine", animation_speed_mod)
|
||||||
else
|
else
|
||||||
player_set_animation(player, "walk", animation_speed_mod)
|
player_set_animation(player, "walk", animation_speed_mod)
|
||||||
end
|
end
|
||||||
elseif controls.LMB then
|
elseif controls.LMB or controls.RMB then
|
||||||
player_set_animation(player, "mine")
|
player_set_animation(player, "mine", animation_speed_mod)
|
||||||
else
|
else
|
||||||
player_set_animation(player, "stand", animation_speed_mod)
|
player_set_animation(player, "stand", animation_speed_mod)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user