Fix DPad on controllers causing animations to lock up when pressing two or more directions at the same time. Release Build 7896.

pull/35/head
sigonasr2 9 months ago
parent 93081fe7f0
commit 462710a44d
  1. 9
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 2
      Adventures in Lestoria/Version.h
  3. BIN
      x64/Release/Adventures in Lestoria.exe

@ -380,16 +380,17 @@ bool AiL::DownHeld(){
return KEY_DOWN.Held()||KEY_SCROLLVERT_L.Analog()>=0.2f; return KEY_DOWN.Held()||KEY_SCROLLVERT_L.Analog()>=0.2f;
} }
bool AiL::LeftReleased(){ bool AiL::LeftReleased(){
return KEY_LEFT.Released()||Input::UsingGamepad()&&player->movementVelocity.x<0&&KEY_SCROLLHORZ_L.Analog()>-0.2f; return KEY_LEFT.Released()||
Input::UsingGamepad()&&!KEY_LEFT.Held()&&player->movementVelocity.x<0&&KEY_SCROLLHORZ_L.Analog()>-0.2f; //Since controller players have the option of using the Left Analog stick or the dpad for movement, we have to make sure both are not being utilized while moving before we can consider an input released.
} }
bool AiL::RightReleased(){ bool AiL::RightReleased(){
return KEY_RIGHT.Released()||Input::UsingGamepad()&&player->movementVelocity.x>0&&KEY_SCROLLHORZ_L.Analog()<0.2f; return KEY_RIGHT.Released()||Input::UsingGamepad()&&!KEY_RIGHT.Held()&&player->movementVelocity.x>0&&KEY_SCROLLHORZ_L.Analog()<0.2f; //Since controller players have the option of using the Left Analog stick or the dpad for movement, we have to make sure both are not being utilized while moving before we can consider an input released.
} }
bool AiL::UpReleased(){ bool AiL::UpReleased(){
return KEY_UP.Released()||Input::UsingGamepad()&&player->movementVelocity.y<0&&KEY_SCROLLVERT_L.Analog()>-0.2f; return KEY_UP.Released()||Input::UsingGamepad()&&!KEY_UP.Held()&&player->movementVelocity.y<0&&KEY_SCROLLVERT_L.Analog()>-0.2f; //Since controller players have the option of using the Left Analog stick or the dpad for movement, we have to make sure both are not being utilized while moving before we can consider an input released.
} }
bool AiL::DownReleased(){ bool AiL::DownReleased(){
return KEY_DOWN.Released()||Input::UsingGamepad()&&player->movementVelocity.y>0&&KEY_SCROLLVERT_L.Analog()<0.2f; return KEY_DOWN.Released()||Input::UsingGamepad()&&!KEY_DOWN.Held()&&player->movementVelocity.y>0&&KEY_SCROLLVERT_L.Analog()<0.2f; //Since controller players have the option of using the Left Analog stick or the dpad for movement, we have to make sure both are not being utilized while moving before we can consider an input released.
} }
bool AiL::LeftPressed(){ bool AiL::LeftPressed(){
return KEY_LEFT.Pressed(); return KEY_LEFT.Pressed();

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 4 #define VERSION_MINOR 4
#define VERSION_PATCH 4 #define VERSION_PATCH 4
#define VERSION_BUILD 7895 #define VERSION_BUILD 7896
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save