mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
AIWander Segmentation Fault Fix - Fixes the segmentation fault that used to occur when there was no pathgrid in the cell and a range was passed to AIWander.
This commit is contained in:
parent
7927ac818c
commit
dbbc96f600
@ -38,6 +38,7 @@ MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay, const
|
|||||||
srand(time(NULL));
|
srand(time(NULL));
|
||||||
mStartTime = MWBase::Environment::get().getWorld()->getTimeStamp();
|
mStartTime = MWBase::Environment::get().getWorld()->getTimeStamp();
|
||||||
mPlayedIdle = 0;
|
mPlayedIdle = 0;
|
||||||
|
mPathgrid = NULL;
|
||||||
mIdleChanceMultiplier =
|
mIdleChanceMultiplier =
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fIdleChanceMultiplier")->getFloat();
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fIdleChanceMultiplier")->getFloat();
|
||||||
|
|
||||||
@ -92,7 +93,9 @@ bool MWMechanics::AiWander::execute (const MWWorld::Ptr& actor)
|
|||||||
mCellX = actor.getCell()->mCell->mData.mX;
|
mCellX = actor.getCell()->mCell->mData.mX;
|
||||||
mCellY = actor.getCell()->mCell->mData.mY;
|
mCellY = actor.getCell()->mCell->mData.mY;
|
||||||
|
|
||||||
if(mPathgrid->mPoints.empty())
|
if(!mPathgrid)
|
||||||
|
mDistance = 0;
|
||||||
|
else if(mPathgrid->mPoints.empty())
|
||||||
mDistance = 0;
|
mDistance = 0;
|
||||||
|
|
||||||
if(mDistance)
|
if(mDistance)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user