mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 19:41:33 +00:00
Make unconscious actors do not speak and do not track targets
This commit is contained in:
parent
3ebb18ce18
commit
f26206b630
2 changed files with 15 additions and 5 deletions
|
@ -567,6 +567,12 @@ namespace MWDialogue
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (actor.getClass().getCreatureStats(actor).getKnockedDown())
|
||||||
|
{
|
||||||
|
// Unconscious actors can not speak
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
const ESM::Dialogue *dial = store.get<ESM::Dialogue>().find(topic);
|
const ESM::Dialogue *dial = store.get<ESM::Dialogue>().find(topic);
|
||||||
|
|
||||||
|
|
|
@ -1232,6 +1232,9 @@ namespace MWMechanics
|
||||||
float sqrHeadTrackDistance = std::numeric_limits<float>::max();
|
float sqrHeadTrackDistance = std::numeric_limits<float>::max();
|
||||||
MWWorld::Ptr headTrackTarget;
|
MWWorld::Ptr headTrackTarget;
|
||||||
|
|
||||||
|
// Unconsious actor can not track target
|
||||||
|
if (!iter->first.getClass().getCreatureStats(iter->first).getKnockedDown())
|
||||||
|
{
|
||||||
for(PtrActorMap::iterator it(mActors.begin()); it != mActors.end(); ++it)
|
for(PtrActorMap::iterator it(mActors.begin()); it != mActors.end(); ++it)
|
||||||
{
|
{
|
||||||
if (it->first == iter->first)
|
if (it->first == iter->first)
|
||||||
|
@ -1240,6 +1243,7 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
iter->second->getCharacterController()->setHeadTrackTarget(headTrackTarget);
|
iter->second->getCharacterController()->setHeadTrackTarget(headTrackTarget);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (iter->first.getClass().isNpc() && iter->first != player)
|
if (iter->first.getClass().isNpc() && iter->first != player)
|
||||||
updateCrimePersuit(iter->first, duration);
|
updateCrimePersuit(iter->first, duration);
|
||||||
|
|
Loading…
Reference in a new issue