Merge remote-tracking branch 'dteviot/FixStuckDraft'

sceneinput
Marc Zinnschlag 9 years ago
commit 315d4d79cd

@ -200,7 +200,7 @@ namespace MWMechanics
//Update every frame
storage.updateCombatMove(duration);
updateActorsMovement(actor, storage.mMovement);
updateActorsMovement(actor, duration, storage.mMovement);
storage.updateAttack(characterController);
storage.mActionCooldown -= duration;
@ -494,7 +494,7 @@ namespace MWMechanics
return false;
}
void AiCombat::updateActorsMovement(const MWWorld::Ptr& actor, MWMechanics::Movement& desiredMovement)
void AiCombat::updateActorsMovement(const MWWorld::Ptr& actor, float duration, MWMechanics::Movement& desiredMovement)
{
MWMechanics::Movement& actorMovementSettings = actor.getClass().getMovementSettings(actor);
if (mPathFinder.isPathConstructed())
@ -506,8 +506,7 @@ namespace MWMechanics
}
else
{
zTurn(actor, mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]));
actorMovementSettings.mPosition[1] = 1;
evadeObstacles(actor, duration, pos);
}
}
else

@ -65,7 +65,7 @@ namespace MWMechanics
AiCombatStorage& storage, MWWorld::Ptr target);
/// Transfer desired movement (from AiCombatStorage) to Actor
void updateActorsMovement(const MWWorld::Ptr& actor, MWMechanics::Movement& movement);
void updateActorsMovement(const MWWorld::Ptr& actor, float duration, MWMechanics::Movement& movement);
void rotateActorOnAxis(const MWWorld::Ptr& actor, int axis,
MWMechanics::Movement& actorMovementSettings, MWMechanics::Movement& desiredMovement);
};

@ -77,7 +77,7 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, ESM::Pathgrid::Po
return false;
}
void MWMechanics::AiPackage::evadeObstacles(const MWWorld::Ptr& actor, float duration, ESM::Position& pos)
void MWMechanics::AiPackage::evadeObstacles(const MWWorld::Ptr& actor, float duration, const ESM::Position& pos)
{
zTurn(actor, mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]));

@ -78,6 +78,8 @@ namespace MWMechanics
virtual bool doesPathNeedRecalc(ESM::Pathgrid::Point dest, const ESM::Cell *cell);
void evadeObstacles(const MWWorld::Ptr& actor, float duration, const ESM::Position& pos);
// TODO: all this does not belong here, move into temporary storage
PathFinder mPathFinder;
ObstacleCheck mObstacleCheck;
@ -87,7 +89,6 @@ namespace MWMechanics
ESM::Pathgrid::Point mPrevDest;
private:
void evadeObstacles(const MWWorld::Ptr& actor, float duration, ESM::Position& pos);
bool isNearInactiveCell(const ESM::Position& actorPos);
};

Loading…
Cancel
Save