aboutsummaryrefslogtreecommitdiff
path: root/src/Person.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Person.cpp')
-rw-r--r--src/Person.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Person.cpp b/src/Person.cpp
index d096b1d..fb05907 100644
--- a/src/Person.cpp
+++ b/src/Person.cpp
@@ -631,14 +631,13 @@ void Person::control()
else
speed = (targetanimation == joganim) ? 2.2 : 2.5;
- if (keyPress(GLFW_KEY_LEFT_CONTROL)
- && currentanimation == idleanim
+ auto crouch = keyPress(keymap.crouch);
+ if (crouch && currentanimation == idleanim
&& targetanimation == idleanim) {
targetanimation = crouchanim;
target = 0;
}
- if (!keyPress(GLFW_KEY_LEFT_CONTROL)
- && currentanimation == crouchanim
+ if (!crouch && currentanimation == crouchanim
&& targetanimation == crouchanim) {
targetanimation = idleanim;
target = 0;
@@ -649,7 +648,7 @@ void Person::control()
if ((onground || visions) && currentanimation != crouchanim) {
playerlowrotation -= right * (forwards ? forwards * 45 : 90);
backwardsanim = forwards < 0;
- auto moveanim = (keyPress(GLFW_KEY_LEFT_SHIFT) || visions)
+ auto moveanim = (keyPress(keymap.accelerate) || visions)
? joganim : walkanim; // Should jog be the default?
if (forwards || right) {
if (targetanimation != moveanim) {