forked from mirror/openmw-tes3mp
Merge pull request #1550 from akortunov/trackingfix
Do not track a nearest actor during combat and pursue
This commit is contained in:
commit
ae9f79c192
1 changed files with 8 additions and 2 deletions
|
@ -1230,8 +1230,13 @@ namespace MWMechanics
|
|||
float sqrHeadTrackDistance = std::numeric_limits<float>::max();
|
||||
MWWorld::Ptr headTrackTarget;
|
||||
|
||||
MWMechanics::CreatureStats& stats = iter->first.getClass().getCreatureStats(iter->first);
|
||||
|
||||
// Unconsious actor can not track target
|
||||
if (!iter->first.getClass().getCreatureStats(iter->first).getKnockedDown())
|
||||
// Also actors in combat and pursue mode do not bother to headtrack
|
||||
if (!stats.getKnockedDown() &&
|
||||
!stats.getAiSequence().isInCombat() &&
|
||||
!stats.getAiSequence().hasPackage(AiPackage::TypeIdPursue))
|
||||
{
|
||||
for(PtrActorMap::iterator it(mActors.begin()); it != mActors.end(); ++it)
|
||||
{
|
||||
|
@ -1239,8 +1244,9 @@ namespace MWMechanics
|
|||
continue;
|
||||
updateHeadTracking(iter->first, it->first, headTrackTarget, sqrHeadTrackDistance);
|
||||
}
|
||||
iter->second->getCharacterController()->setHeadTrackTarget(headTrackTarget);
|
||||
}
|
||||
|
||||
iter->second->getCharacterController()->setHeadTrackTarget(headTrackTarget);
|
||||
}
|
||||
|
||||
if (iter->first.getClass().isNpc() && iter->first != player)
|
||||
|
|
Loading…
Reference in a new issue