mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Merge pull request #1579
This commit is contained in:
commit
1d823d8ae1
2 changed files with 8 additions and 1 deletions
|
@ -1009,7 +1009,8 @@ namespace MWMechanics
|
||||||
if (player.getClass().getNpcStats(player).isWerewolf())
|
if (player.getClass().getNpcStats(player).isWerewolf())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ptr.getClass().isClass(ptr, "Guard") && creatureStats.getAiSequence().getTypeId() != AiPackage::TypeIdPursue && !creatureStats.getAiSequence().isInCombat())
|
if (ptr.getClass().isClass(ptr, "Guard") && creatureStats.getAiSequence().getTypeId() != AiPackage::TypeIdPursue && !creatureStats.getAiSequence().isInCombat()
|
||||||
|
&& creatureStats.getMagicEffects().get(ESM::MagicEffect::CalmHumanoid).getMagnitude() == 0)
|
||||||
{
|
{
|
||||||
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
|
||||||
static const int cutoff = esmStore.get<ESM::GameSetting>().find("iCrimeThreshold")->getInt();
|
static const int cutoff = esmStore.get<ESM::GameSetting>().find("iCrimeThreshold")->getInt();
|
||||||
|
|
|
@ -1653,6 +1653,12 @@ namespace MWMechanics
|
||||||
|
|
||||||
bool MechanicsManager::isAggressive(const MWWorld::Ptr &ptr, const MWWorld::Ptr &target)
|
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;
|
int disposition = 50;
|
||||||
if (ptr.getClass().isNpc())
|
if (ptr.getClass().isNpc())
|
||||||
disposition = getDerivedDisposition(ptr, true);
|
disposition = getDerivedDisposition(ptr, true);
|
||||||
|
|
Loading…
Reference in a new issue