mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
Make AiWander::isPackageCompleted const
This commit is contained in:
parent
131f2557b1
commit
256c9917a4
@ -235,8 +235,9 @@ namespace MWMechanics
|
||||
if (mDistance <= 0)
|
||||
storage.mCanWanderAlongPathGrid = false;
|
||||
|
||||
if (isPackageCompleted(actor))
|
||||
if (isPackageCompleted())
|
||||
{
|
||||
stopWalking(actor);
|
||||
// Reset package so it can be used again
|
||||
mRemainingDuration=mDuration;
|
||||
init();
|
||||
@ -320,19 +321,10 @@ namespace MWMechanics
|
||||
return actor.getRefData().getPosition().asVec3();
|
||||
}
|
||||
|
||||
bool AiWander::isPackageCompleted(const MWWorld::Ptr& actor)
|
||||
bool AiWander::isPackageCompleted() const
|
||||
{
|
||||
if (mDuration)
|
||||
{
|
||||
// End package if duration is complete
|
||||
if (mRemainingDuration <= 0)
|
||||
{
|
||||
stopWalking(actor);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// if get here, not yet completed
|
||||
return false;
|
||||
// End package if duration is complete
|
||||
return mDuration && mRemainingDuration <= 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -133,7 +133,7 @@ namespace MWMechanics
|
||||
void onWalkingStatePerFrameActions(const MWWorld::Ptr& actor, float duration, AiWanderStorage& storage);
|
||||
void onChooseActionStatePerFrameActions(const MWWorld::Ptr& actor, AiWanderStorage& storage);
|
||||
bool reactionTimeActions(const MWWorld::Ptr& actor, AiWanderStorage& storage, ESM::Position& pos);
|
||||
bool isPackageCompleted(const MWWorld::Ptr& actor);
|
||||
inline bool isPackageCompleted() const;
|
||||
void wanderNearStart(const MWWorld::Ptr &actor, AiWanderStorage &storage, int wanderDistance);
|
||||
bool destinationIsAtWater(const MWWorld::Ptr &actor, const osg::Vec3f& destination);
|
||||
void completeManualWalking(const MWWorld::Ptr &actor, AiWanderStorage &storage);
|
||||
|
Loading…
x
Reference in New Issue
Block a user