forked from teamnwah/openmw-tes3coop
Prevent combat on/off cycling for calmed actors
This commit is contained in:
parent
e0c54b3f39
commit
7e87ce8787
1 changed files with 6 additions and 0 deletions
|
@ -1653,6 +1653,12 @@ namespace MWMechanics
|
|||
|
||||
bool MechanicsManager::isAggressive(const MWWorld::Ptr &ptr, const MWWorld::Ptr &target)
|
||||
{
|
||||
// Don't become aggressive if a calm effect is active, since it would cause combat to cycle on/off as
|
||||
// combat is activated here and then canceled by the calm effect
|
||||
if ((ptr.getClass().isNpc() && ptr.getClass().getCreatureStats(ptr).getMagicEffects().get(ESM::MagicEffect::CalmHumanoid).getMagnitude() > 0)
|
||||
|| (!ptr.getClass().isNpc() && ptr.getClass().getCreatureStats(ptr).getMagicEffects().get(ESM::MagicEffect::CalmCreature).getMagnitude() > 0))
|
||||
return false;
|
||||
|
||||
int disposition = 50;
|
||||
if (ptr.getClass().isNpc())
|
||||
disposition = getDerivedDisposition(ptr, true);
|
||||
|
|
Loading…
Reference in a new issue