1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 21:35:24 +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() void CharacterController::setAttackTypeBasedOnMovement()
{ {
float *move = mPtr.getClass().getMovementSettings(mPtr).mPosition; float *move = mPtr.getClass().getMovementSettings(mPtr).mPosition;
if (std::abs(move[1]) > std::abs(move[0]) + 0.2f) // forward-backward
if (move[1] && !move[0]) // forward-backward
mAttackType = "thrust"; mAttackType = "thrust";
else if (move[0] && !move[1]) //sideway else if (std::abs(move[0]) > std::abs(move[1]) + 0.2f) // sideway
mAttackType = "slash"; mAttackType = "slash";
else else
mAttackType = "chop"; mAttackType = "chop";