Fix crash updating DORDER_PATROL.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9487 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
bac704a7cf
commit
ccef0c4b47
|
@ -535,14 +535,14 @@ void orderUpdateDroid(DROID *psDroid)
|
|||
{
|
||||
tooFarFromPath = false;
|
||||
}
|
||||
else if (deltaX >= deltaY &&
|
||||
else if (abs(deltaX) >= abs(deltaY) &&
|
||||
(SDWORD)MIN(psDroid->orderX, psDroid->orderX2)-SCOUT_DIST <= psDroid->pos.x &&
|
||||
psDroid->pos.x <= (SDWORD)MAX(psDroid->orderX, psDroid->orderX2)+SCOUT_DIST)
|
||||
{
|
||||
tooFarFromPath = (abs(((SDWORD)psDroid->pos.x - (SDWORD)psDroid->orderX) * deltaY/deltaX +
|
||||
(SDWORD)psDroid->orderY - (SDWORD)psDroid->pos.y) > SCOUT_DIST);
|
||||
}
|
||||
else if (deltaX <= deltaY &&
|
||||
else if (abs(deltaX) <= abs(deltaY) &&
|
||||
(SDWORD)MIN(psDroid->orderY, psDroid->orderY2)-SCOUT_DIST <= psDroid->pos.y &&
|
||||
psDroid->pos.y <= (SDWORD)MAX(psDroid->orderY, psDroid->orderY2)+SCOUT_DIST)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue