diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 78b67796..304bf76f 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -784,7 +784,11 @@ geom2d::circleMonster::Hitbox(){ } void Monster::Knockback(const vf2d&vel){ + //A new angle will be applied, but will be constrained by whichever applied velocity is strongest (either the current velocity, or the new one). This prevents continuous uncapped velocities to knockbacks applied. + float maxVelThreshold=std::max(vel.mag(),this->vel.mag()); this->vel+=vel; + float newVelAngle=this->vel.polar().y; + this->vel=vf2d{maxVelThreshold,newVelAngle}.cart(); } void Monster::Knockup(float duration){ diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index 96095e9c..5e21d23c 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -305,9 +305,11 @@ State::State Player::GetState(){ } void Player::Knockback(vf2d vel){ - if(!HasIframes()){ - this->vel+=vel; - } + //A new angle will be applied, but will be constrained by whichever applied velocity is strongest (either the current velocity, or the new one). This prevents continuous uncapped velocities to knockbacks applied. + float maxVelThreshold=std::max(vel.mag(),this->vel.mag()); + this->vel+=vel; + float newVelAngle=this->vel.polar().y; + this->vel=vf2d{maxVelThreshold,newVelAngle}.cart(); } void Player::Update(float fElapsedTime){ diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 6ce3f286..3f301300 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 2 -#define VERSION_BUILD 8955 +#define VERSION_BUILD 8957 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 623615ec..49e1b7c7 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ