1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 07:23:54 +00:00

Fix CharacterController::setAttackTypeBasedOnMovement

This commit is contained in:
Petr Mikheev 2020-08-31 01:25:53 +02:00
parent bd6b984022
commit 6a75942907

View file

@ -2737,10 +2737,9 @@ void CharacterController::setVisibility(float visibility)
void CharacterController::setAttackTypeBasedOnMovement()
{
float *move = mPtr.getClass().getMovementSettings(mPtr).mPosition;
if (move[1] && !move[0]) // forward-backward
if (std::abs(move[1]) > std::abs(move[0]) + 0.2f) // forward-backward
mAttackType = "thrust";
else if (move[0] && !move[1]) //sideway
else if (std::abs(move[0]) > std::abs(move[1]) + 0.2f) // sideway
mAttackType = "slash";
else
mAttackType = "chop";