|
|
|
@ -78,7 +78,7 @@ class CheckActorCommanded : public MWMechanics::EffectSourceVisitor
|
|
|
|
|
MWWorld::Ptr mActor;
|
|
|
|
|
public:
|
|
|
|
|
bool mCommanded;
|
|
|
|
|
CheckActorCommanded(MWWorld::Ptr actor)
|
|
|
|
|
CheckActorCommanded(const MWWorld::Ptr& actor)
|
|
|
|
|
: mActor(actor)
|
|
|
|
|
, mCommanded(false){}
|
|
|
|
|
|
|
|
|
@ -114,9 +114,7 @@ void adjustCommandedActor (const MWWorld::Ptr& actor)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!check.mCommanded && hasCommandPackage)
|
|
|
|
|
{
|
|
|
|
|
stats.getAiSequence().erase(it);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getRestorationPerHourOfSleep (const MWWorld::Ptr& ptr, float& health, float& magicka)
|
|
|
|
@ -151,7 +149,7 @@ namespace MWMechanics
|
|
|
|
|
MWWorld::Ptr mActor;
|
|
|
|
|
bool mTrapped;
|
|
|
|
|
public:
|
|
|
|
|
SoulTrap(MWWorld::Ptr trappedCreature)
|
|
|
|
|
SoulTrap(const MWWorld::Ptr& trappedCreature)
|
|
|
|
|
: mCreature(trappedCreature)
|
|
|
|
|
, mTrapped(false)
|
|
|
|
|
{
|
|
|
|
@ -722,16 +720,8 @@ namespace MWMechanics
|
|
|
|
|
|
|
|
|
|
// any value of calm > 0 will stop the actor from fighting
|
|
|
|
|
if ((effects.get(ESM::MagicEffect::CalmHumanoid).getMagnitude() > 0 && ptr.getClass().isNpc())
|
|
|
|
|
|| (effects.get(ESM::MagicEffect::CalmCreature).getMagnitude() > 0 && !ptr.getClass().isNpc()))
|
|
|
|
|
{
|
|
|
|
|
for (std::list<AiPackage*>::const_iterator it = creatureStats.getAiSequence().begin(); it != creatureStats.getAiSequence().end(); )
|
|
|
|
|
{
|
|
|
|
|
if ((*it)->getTypeId() == AiPackage::TypeIdCombat)
|
|
|
|
|
it = creatureStats.getAiSequence().erase(it);
|
|
|
|
|
else
|
|
|
|
|
++it;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|| (effects.get(ESM::MagicEffect::CalmCreature).getMagnitude() > 0 && !ptr.getClass().isNpc()))
|
|
|
|
|
creatureStats.getAiSequence().stopCombat();
|
|
|
|
|
|
|
|
|
|
// Update bound effects
|
|
|
|
|
// Note: in vanilla MW multiple bound items of the same type can be created by different spells.
|
|
|
|
@ -820,7 +810,7 @@ namespace MWMechanics
|
|
|
|
|
NpcStats &stats = ptr.getClass().getNpcStats(ptr);
|
|
|
|
|
|
|
|
|
|
// When npc stats are just initialized, mTimeToStartDrowning == -1 and we should get value from GMST
|
|
|
|
|
static const int fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHoldBreathTime")->getFloat();
|
|
|
|
|
static const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHoldBreathTime")->getFloat();
|
|
|
|
|
if (stats.getTimeToStartDrowning() == -1.f)
|
|
|
|
|
stats.setTimeToStartDrowning(fHoldBreathTime);
|
|
|
|
|
|
|
|
|
@ -860,10 +850,7 @@ namespace MWMechanics
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
static const float fHoldBreathTime = world->getStore().get<ESM::GameSetting>().find("fHoldBreathTime")->getFloat();
|
|
|
|
|
stats.setTimeToStartDrowning(fHoldBreathTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Actors::updateEquippedLight (const MWWorld::Ptr& ptr, float duration)
|
|
|
|
|