mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 09:23:51 +00:00
Issue #389: added AI sequence to CreatureStats; execute AI packages during the regular actor update
This commit is contained in:
parent
345eec1135
commit
ead04e1cc3
3 changed files with 20 additions and 0 deletions
|
@ -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…
Reference in a new issue