mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-18 15:46:37 +00:00
Move early out to better place
This commit is contained in:
parent
09ed5bb234
commit
2db36c49b5
2 changed files with 7 additions and 8 deletions
|
@ -124,6 +124,13 @@ namespace MWMechanics
|
||||||
if (actor == target) // This should never happen.
|
if (actor == target) // This should never happen.
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// No actions for totally static creatures
|
||||||
|
if (!actor.getClass().isMobile(actor))
|
||||||
|
{
|
||||||
|
storage.mFleeState = AiCombatStorage::FleeState_Idle;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!storage.isFleeing())
|
if (!storage.isFleeing())
|
||||||
{
|
{
|
||||||
if (storage.mCurrentAction.get()) // need to wait to init action with its attack range
|
if (storage.mCurrentAction.get()) // need to wait to init action with its attack range
|
||||||
|
@ -231,10 +238,6 @@ namespace MWMechanics
|
||||||
storage.stopFleeing();
|
storage.stopFleeing();
|
||||||
}
|
}
|
||||||
|
|
||||||
// No attack actions for totally static creatures
|
|
||||||
if (!actor.getClass().isMobile(actor))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
bool isRangedCombat = false;
|
bool isRangedCombat = false;
|
||||||
float& rangeAttack = storage.mAttackRange;
|
float& rangeAttack = storage.mAttackRange;
|
||||||
|
|
||||||
|
|
|
@ -135,10 +135,6 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
|
||||||
MWWorld::MovementDirectionFlags supportedMovementDirections, float destTolerance, float endTolerance,
|
MWWorld::MovementDirectionFlags supportedMovementDirections, float destTolerance, float endTolerance,
|
||||||
PathType pathType)
|
PathType pathType)
|
||||||
{
|
{
|
||||||
// No pathing for totally static creatures
|
|
||||||
if (!actor.getClass().isMobile(actor))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
const Misc::TimerStatus timerStatus = mReaction.update(duration);
|
const Misc::TimerStatus timerStatus = mReaction.update(duration);
|
||||||
|
|
||||||
const osg::Vec3f position = actor.getRefData().getPosition().asVec3(); // position of the actor
|
const osg::Vec3f position = actor.getRefData().getPosition().asVec3(); // position of the actor
|
||||||
|
|
Loading…
Reference in a new issue