1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Allow binding dig, place actions to keys; remove LMB/RMB hardcoding

Co-authored-by: Sam Caulfield <sam@samcaulfield.com>
This commit is contained in:
ANAND 2020-06-05 18:36:35 +05:30 committed by celeron55
parent fff0393187
commit 291a6b70d6
14 changed files with 284 additions and 310 deletions

View file

@ -975,13 +975,13 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
if (controls.sneak && walking)
new_speed /= 2;
if (walking && (controls.LMB || controls.RMB)) {
if (walking && (controls.dig || controls.place)) {
new_anim = player->local_animations[3];
player->last_animation = WD_ANIM;
} else if(walking) {
} else if (walking) {
new_anim = player->local_animations[1];
player->last_animation = WALK_ANIM;
} else if(controls.LMB || controls.RMB) {
} else if (controls.dig || controls.place) {
new_anim = player->local_animations[2];
player->last_animation = DIG_ANIM;
}
@ -1004,9 +1004,9 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
// Update local player animations
if ((player->last_animation != old_anim ||
m_animation_speed != old_anim_speed) &&
player->last_animation != NO_ANIM && allow_update)
updateAnimation();
m_animation_speed != old_anim_speed) &&
player->last_animation != NO_ANIM && allow_update)
updateAnimation();
}
}