aboutsummaryrefslogtreecommitdiff
path: root/src/Person.cpp
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-10-29 11:56:11 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-10-29 11:56:11 +0700
commit9953dae353e6166946e21430f63854927d1db2d7 (patch)
treed6c4b6caf4fca5faacd103ba523e23356abfd5c6 /src/Person.cpp
parentbd8985065f2377a62f0ee9f4236d5cd9ad99dfe4 (diff)
downloadblackshades-9953dae353e6166946e21430f63854927d1db2d7.tar.gz
Make the rest keys configurable
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) {