mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 16:20:21 +00:00
extracted function reactionTimeActions().
This commit is contained in:
parent
9c0e3d6c28
commit
ad0d807103
@ -199,15 +199,18 @@ namespace MWMechanics
|
|||||||
|
|
||||||
float& lastReaction = storage.mReaction;
|
float& lastReaction = storage.mReaction;
|
||||||
lastReaction += duration;
|
lastReaction += duration;
|
||||||
if(lastReaction < REACTION_INTERVAL)
|
if (REACTION_INTERVAL <= lastReaction)
|
||||||
{
|
{
|
||||||
return false;
|
lastReaction = 0;
|
||||||
|
return reactionTimeActions(actor, storage, currentCell, cellChange, pos);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lastReaction = 0;
|
return false;
|
||||||
|
}
|
||||||
// NOTE: everything below get updated every REACTION_INTERVAL seconds
|
|
||||||
|
|
||||||
|
bool AiWander::reactionTimeActions(const MWWorld::Ptr& actor, AiWanderStorage& storage,
|
||||||
|
const MWWorld::CellStore*& currentCell, bool cellChange, ESM::Position& pos)
|
||||||
|
{
|
||||||
if(mDuration)
|
if(mDuration)
|
||||||
{
|
{
|
||||||
// End package if duration is complete or mid-night hits:
|
// End package if duration is complete or mid-night hits:
|
||||||
|
@ -87,6 +87,8 @@ namespace MWMechanics
|
|||||||
void onIdleStatePerFrameActions(const MWWorld::Ptr& actor, float duration, AiWanderStorage& storage);
|
void onIdleStatePerFrameActions(const MWWorld::Ptr& actor, float duration, AiWanderStorage& storage);
|
||||||
void onWalkingStatePerFrameActions(const MWWorld::Ptr& actor, float duration, AiWanderStorage& storage, ESM::Position& pos);
|
void onWalkingStatePerFrameActions(const MWWorld::Ptr& actor, float duration, AiWanderStorage& storage, ESM::Position& pos);
|
||||||
void onChooseActionStatePerFrameActions(const MWWorld::Ptr& actor, AiWanderStorage& storage);
|
void onChooseActionStatePerFrameActions(const MWWorld::Ptr& actor, AiWanderStorage& storage);
|
||||||
|
bool reactionTimeActions(const MWWorld::Ptr& actor, AiWanderStorage& storage,
|
||||||
|
const MWWorld::CellStore*& currentCell, bool cellChange, ESM::Position& pos);
|
||||||
|
|
||||||
int mDistance; // how far the actor can wander from the spawn point
|
int mDistance; // how far the actor can wander from the spawn point
|
||||||
int mDuration;
|
int mDuration;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user