mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 19:20:49 +00:00
extracted function reactionTimeActions().
This commit is contained in:
parent
9c0e3d6c28
commit
ad0d807103
@ -199,15 +199,18 @@ namespace MWMechanics
|
||||
|
||||
float& lastReaction = storage.mReaction;
|
||||
lastReaction += duration;
|
||||
if(lastReaction < REACTION_INTERVAL)
|
||||
if (REACTION_INTERVAL <= lastReaction)
|
||||
{
|
||||
return false;
|
||||
lastReaction = 0;
|
||||
return reactionTimeActions(actor, storage, currentCell, cellChange, pos);
|
||||
}
|
||||
else
|
||||
lastReaction = 0;
|
||||
|
||||
// NOTE: everything below get updated every REACTION_INTERVAL seconds
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AiWander::reactionTimeActions(const MWWorld::Ptr& actor, AiWanderStorage& storage,
|
||||
const MWWorld::CellStore*& currentCell, bool cellChange, ESM::Position& pos)
|
||||
{
|
||||
if(mDuration)
|
||||
{
|
||||
// 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 onWalkingStatePerFrameActions(const MWWorld::Ptr& actor, float duration, AiWanderStorage& storage, ESM::Position& pos);
|
||||
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 mDuration;
|
||||
|
Loading…
x
Reference in New Issue
Block a user