mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02: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:
@@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user