The 'may be used uninitialized' doesn't seem to be meaningless to me.
Modified code to avoid the possible side effect race, which also simplified code flow. Fabrice, please check.
This commit is contained in:
parent
16a19db621
commit
4ca3e082bd
1 changed files with 4 additions and 4 deletions
|
@ -500,14 +500,14 @@ local int AStarFindPath(Unit* unit,int* pxd,int* pyd)
|
|||
path_length=0;
|
||||
x=unit->X;
|
||||
y=unit->Y;
|
||||
DebugLevel3("%d %d %d %d\n",x,y,ex,ey);
|
||||
IfDebug(i = 0);
|
||||
while(ex != x || ey !=y) {
|
||||
for(;;) {
|
||||
DebugLevel3("%d %d %d %d\n",x,y,ex,ey);
|
||||
eo=ex*TheMap.Width+ey;
|
||||
i=AStarMatrix[eo].Direction;
|
||||
if (ex == x && ey == y)
|
||||
break;
|
||||
ex-=xoffset[i];
|
||||
ey-=yoffset[i];
|
||||
DebugLevel3("%d %d %d %d\n",x,y,ex,ey);
|
||||
path_length++;
|
||||
}
|
||||
*pxd=xoffset[i];
|
||||
|
|
Loading…
Reference in a new issue