aboutsummaryrefslogtreecommitdiff
path: root/src/client/content_cao.cpp
diff options
context:
space:
mode:
authorANAND <ClobberXD@protonmail.com>2020-06-05 18:36:35 +0530
committerceleron55 <celeron55@gmail.com>2020-08-15 12:19:20 +0300
commit291a6b70d674d9003f522b5875a60f7e2753e32b (patch)
treeeb4368dfc8d0055b53bd1160b5a8836726245ffb /src/client/content_cao.cpp
parentfff03931871b68e092e12bfce9056f760e8ec9dd (diff)
downloadminetest-291a6b70d674d9003f522b5875a60f7e2753e32b.tar.gz
minetest-291a6b70d674d9003f522b5875a60f7e2753e32b.tar.bz2
minetest-291a6b70d674d9003f522b5875a60f7e2753e32b.zip
Allow binding dig, place actions to keys; remove LMB/RMB hardcoding
Co-authored-by: Sam Caulfield <sam@samcaulfield.com>
Diffstat (limited to 'src/client/content_cao.cpp')
-rw-r--r--src/client/content_cao.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp
index 88688d18c..599139aa3 100644
--- a/src/client/content_cao.cpp
+++ b/src/client/content_cao.cpp
@@ -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();
}
}