Finish turning before attacking

macos-builds-only-for-openmw
Langerz82 5 years ago committed by Evil Eye
parent 5fbfbb3d84
commit 303082f6b4

@ -137,7 +137,10 @@ namespace MWMechanics
}
storage.updateCombatMove(duration);
storage.mRotateMove = false;
if (storage.mReadyToAttack) updateActorsMovement(actor, duration, storage);
if (storage.mRotateMove)
return false;
storage.updateAttack(characterController);
}
else
@ -442,7 +445,7 @@ namespace MWMechanics
storage.mCurrentAction->getCombatRange(isRangedCombat);
float eps = isRangedCombat ? osg::DegreesToRadians(0.5) : osg::DegreesToRadians(3.f);
float targetAngleRadians = storage.mMovement.mRotation[axis];
smoothTurn(actor, targetAngleRadians, axis, eps);
storage.mRotateMove = !smoothTurn(actor, targetAngleRadians, axis, eps);
}
MWWorld::Ptr AiCombat::getTarget() const

@ -33,6 +33,7 @@ namespace MWMechanics
bool mAttack;
float mAttackRange;
bool mCombatMove;
bool mRotateMove;
osg::Vec3f mLastTargetPos;
const MWWorld::CellStore* mCell;
std::shared_ptr<Action> mCurrentAction;
@ -65,6 +66,7 @@ namespace MWMechanics
mAttack(false),
mAttackRange(0.0f),
mCombatMove(false),
mRotateMove(false),
mLastTargetPos(0,0,0),
mCell(nullptr),
mCurrentAction(),

Loading…
Cancel
Save