1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-18 04:10:06 +00:00

Make unconscious actors do not speak and do not track targets

This commit is contained in:
Andrei Kortunov 2017-09-30 20:55:42 +04:00
parent 3ebb18ce18
commit f26206b630
2 changed files with 15 additions and 5 deletions

View File

@ -567,6 +567,12 @@ namespace MWDialogue
return;
}
if (actor.getClass().getCreatureStats(actor).getKnockedDown())
{
// Unconscious actors can not speak
return;
}
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const ESM::Dialogue *dial = store.get<ESM::Dialogue>().find(topic);

View File

@ -1232,13 +1232,17 @@ namespace MWMechanics
float sqrHeadTrackDistance = std::numeric_limits<float>::max();
MWWorld::Ptr headTrackTarget;
for(PtrActorMap::iterator it(mActors.begin()); it != mActors.end(); ++it)
// Unconsious actor can not track target
if (!iter->first.getClass().getCreatureStats(iter->first).getKnockedDown())
{
if (it->first == iter->first)
continue;
updateHeadTracking(iter->first, it->first, headTrackTarget, sqrHeadTrackDistance);
for(PtrActorMap::iterator it(mActors.begin()); it != mActors.end(); ++it)
{
if (it->first == iter->first)
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)