mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 22:45:34 +00:00
Ignore dead actors in getActorsFollowing/Fighting
Prevents dead enemies from disallowing resting near them
This commit is contained in:
parent
27a05027f4
commit
0796815da0
1 changed files with 2 additions and 2 deletions
|
@ -1019,7 +1019,7 @@ namespace MWMechanics
|
|||
const MWWorld::Class &cls = MWWorld::Class::get(iter->first);
|
||||
CreatureStats &stats = cls.getCreatureStats(iter->first);
|
||||
|
||||
if(stats.getAiSequence().getTypeId() == AiPackage::TypeIdFollow)
|
||||
if(!stats.isDead() && stats.getAiSequence().getTypeId() == AiPackage::TypeIdFollow)
|
||||
{
|
||||
MWMechanics::AiFollow* package = static_cast<MWMechanics::AiFollow*>(stats.getAiSequence().getActivePackage());
|
||||
if(package->getFollowedActor() == actor.getCellRef().mRefID)
|
||||
|
@ -1041,7 +1041,7 @@ namespace MWMechanics
|
|||
const MWWorld::Class &cls = MWWorld::Class::get(*iter);
|
||||
CreatureStats &stats = cls.getCreatureStats(*iter);
|
||||
|
||||
if(stats.getAiSequence().getTypeId() == AiPackage::TypeIdCombat)
|
||||
if(!stats.isDead() && stats.getAiSequence().getTypeId() == AiPackage::TypeIdCombat)
|
||||
{
|
||||
MWMechanics::AiCombat* package = static_cast<MWMechanics::AiCombat*>(stats.getAiSequence().getActivePackage());
|
||||
if(package->getTargetId() == actor.getCellRef().mRefID)
|
||||
|
|
Loading…
Reference in a new issue