mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 05:39:41 +00:00
Finish turning before attacking
This commit is contained in:
parent
5fbfbb3d84
commit
303082f6b4
2 changed files with 6 additions and 1 deletions
apps/openmw/mwmechanics
|
@ -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…
Reference in a new issue