mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-28 23:06:43 +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);
|
adjustMagicEffects (ptr);
|
||||||
calculateCreatureStatModifiers (ptr);
|
calculateCreatureStatModifiers (ptr);
|
||||||
calculateDynamicStats (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)
|
void Actors::updateNpc (const MWWorld::Ptr& ptr, float duration, bool paused)
|
||||||
|
|
|
@ -45,4 +45,14 @@ namespace MWMechanics
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const AiSequence& CreatureStats::getAiSequence() const
|
||||||
|
{
|
||||||
|
return mAiSequence;
|
||||||
|
}
|
||||||
|
|
||||||
|
AiSequence& CreatureStats::getAiSequence()
|
||||||
|
{
|
||||||
|
return mAiSequence;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "magiceffects.hpp"
|
#include "magiceffects.hpp"
|
||||||
#include "spells.hpp"
|
#include "spells.hpp"
|
||||||
#include "activespells.hpp"
|
#include "activespells.hpp"
|
||||||
|
#include "aisequence.hpp"
|
||||||
|
|
||||||
namespace MWMechanics
|
namespace MWMechanics
|
||||||
{
|
{
|
||||||
|
@ -27,6 +28,7 @@ namespace MWMechanics
|
||||||
int mFight;
|
int mFight;
|
||||||
int mFlee;
|
int mFlee;
|
||||||
int mAlarm;
|
int mAlarm;
|
||||||
|
AiSequence mAiSequence;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CreatureStats();
|
CreatureStats();
|
||||||
|
@ -100,6 +102,10 @@ namespace MWMechanics
|
||||||
void setFlee(int value);
|
void setFlee(int value);
|
||||||
|
|
||||||
void setAlarm(int value);
|
void setAlarm(int value);
|
||||||
|
|
||||||
|
const AiSequence& getAiSequence() const;
|
||||||
|
|
||||||
|
AiSequence& getAiSequence();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Inline const getters
|
// Inline const getters
|
||||||
|
|
Loading…
Reference in a new issue