Issue #389: added AI sequence to CreatureStats; execute AI packages during the regular actor update

actorid
Marc Zinnschlag 13 years ago
parent 345eec1135
commit ead04e1cc3

@ -20,6 +20,10 @@ namespace MWMechanics
adjustMagicEffects (ptr);
calculateCreatureStatModifiers (ptr);
calculateDynamicStats (ptr);
// AI
CreatureStats& creatureStats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
creatureStats.getAiSequence().execute (ptr);
}
void Actors::updateNpc (const MWWorld::Ptr& ptr, float duration, bool paused)

@ -45,4 +45,14 @@ namespace MWMechanics
return *this;
}
const AiSequence& CreatureStats::getAiSequence() const
{
return mAiSequence;
}
AiSequence& CreatureStats::getAiSequence()
{
return mAiSequence;
}
}

@ -9,6 +9,7 @@
#include "magiceffects.hpp"
#include "spells.hpp"
#include "activespells.hpp"
#include "aisequence.hpp"
namespace MWMechanics
{
@ -27,6 +28,7 @@ namespace MWMechanics
int mFight;
int mFlee;
int mAlarm;
AiSequence mAiSequence;
public:
CreatureStats();
@ -100,6 +102,10 @@ namespace MWMechanics
void setFlee(int value);
void setAlarm(int value);
const AiSequence& getAiSequence() const;
AiSequence& getAiSequence();
};
// Inline const getters

Loading…
Cancel
Save