forked from teamnwah/openmw-tes3coop
Wrong logic... should improve performances
This commit is contained in:
parent
0609b71df9
commit
f41f08c352
1 changed files with 6 additions and 5 deletions
|
@ -77,13 +77,14 @@ namespace MWMechanics
|
||||||
mPathFinder.buildPath(start, dest, pathgrid, xCell, yCell, true);
|
mPathFinder.buildPath(start, dest, pathgrid, xCell, yCell, true);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mPathFinder2.buildPath(start, dest, pathgrid, xCell, yCell, true);
|
if(mTimer2 > 0.25)
|
||||||
ESM::Pathgrid::Point lastPt = mPathFinder.getPath().back();
|
|
||||||
if((mTimer2 > 0.25)&&(mPathFinder2.getPathSize() < mPathFinder.getPathSize() ||
|
|
||||||
(dest.mX - lastPt.mX)*(dest.mX - lastPt.mX)+(dest.mY - lastPt.mY)*(dest.mY - lastPt.mY)+(dest.mZ - lastPt.mZ)*(dest.mZ - lastPt.mZ) > 200*200))
|
|
||||||
{
|
{
|
||||||
mTimer2 = 0;
|
mTimer2 = 0;
|
||||||
mPathFinder = mPathFinder2;
|
mPathFinder2.buildPath(start, dest, pathgrid, xCell, yCell, true);
|
||||||
|
ESM::Pathgrid::Point lastPt = mPathFinder.getPath().back();
|
||||||
|
if(mPathFinder2.getPathSize() < mPathFinder.getPathSize() ||
|
||||||
|
(dest.mX - lastPt.mX)*(dest.mX - lastPt.mX)+(dest.mY - lastPt.mY)*(dest.mY - lastPt.mY)+(dest.mZ - lastPt.mZ)*(dest.mZ - lastPt.mZ) > 200*200)
|
||||||
|
mPathFinder = mPathFinder2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue