diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 51596ef9..754afa42 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -838,7 +838,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 9f88c174..2ef9244d 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 0 -#define VERSION_BUILD 9176 +#define VERSION_BUILD 9177 #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 03bdd512..51a3a3d1 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ