mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:23:51 +00:00
[Client] Enable head rotation AI for DedicatedActors
This commit is contained in:
parent
8ebe7ed683
commit
f64580bc10
1 changed files with 10 additions and 9 deletions
|
@ -1152,19 +1152,17 @@ namespace MWMechanics
|
||||||
/*
|
/*
|
||||||
Start of tes3mp change (major)
|
Start of tes3mp change (major)
|
||||||
|
|
||||||
Allow AI processing when LiveCellRefBase's isLocalActor set to true
|
Allow AI processing for LocalActors and partially for DedicatedActors
|
||||||
*/
|
*/
|
||||||
|
bool isAIActive = MWBase::Environment::get().getMechanicsManager()->isAIActive();
|
||||||
bool isLocalActor = mwmp::Main::get().getCellController()->isLocalActor(actor);
|
bool isLocalActor = mwmp::Main::get().getCellController()->isLocalActor(actor);
|
||||||
|
bool isDedicatedActor = mwmp::Main::get().getCellController()->isDedicatedActor(actor);
|
||||||
|
|
||||||
//if (MWBase::Environment::get().getMechanicsManager()->isAIActive() && inProcessingRange)
|
//if (MWBase::Environment::get().getMechanicsManager()->isAIActive() && inProcessingRange)
|
||||||
|
|
||||||
if ((MWBase::Environment::get().getMechanicsManager()->isAIActive() || isLocalActor)
|
if (inProcessingRange && (isAIActive || isLocalActor || isDedicatedActor))
|
||||||
&& inProcessingRange)
|
|
||||||
/*
|
|
||||||
End of tes3mp change (major)
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
if (timerUpdateAITargets == 0)
|
if (timerUpdateAITargets == 0 && (isLocalActor || isAIActive))
|
||||||
{
|
{
|
||||||
if (iter->first != player)
|
if (iter->first != player)
|
||||||
adjustCommandedActor(iter->first);
|
adjustCommandedActor(iter->first);
|
||||||
|
@ -1190,10 +1188,10 @@ 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 && (isLocalActor || isAIActive))
|
||||||
updateCrimePersuit(iter->first, duration);
|
updateCrimePersuit(iter->first, duration);
|
||||||
|
|
||||||
if (iter->first != player)
|
if (iter->first != player && (isLocalActor || isAIActive))
|
||||||
{
|
{
|
||||||
CreatureStats &stats = iter->first.getClass().getCreatureStats(iter->first);
|
CreatureStats &stats = iter->first.getClass().getCreatureStats(iter->first);
|
||||||
if (isConscious(iter->first))
|
if (isConscious(iter->first))
|
||||||
|
@ -1202,6 +1200,9 @@ namespace MWMechanics
|
||||||
if (stats.getAiSequence().isInCombat() && !stats.isDead()) hostilesCount++;
|
if (stats.getAiSequence().isInCombat() && !stats.isDead()) hostilesCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
End of tes3mp change (major)
|
||||||
|
*/
|
||||||
|
|
||||||
if(iter->first.getTypeName() == typeid(ESM::NPC).name())
|
if(iter->first.getTypeName() == typeid(ESM::NPC).name())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue