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:
ariclone 2000-07-05 19:11:42 +00:00
parent 16a19db621
commit 4ca3e082bd

View file

@ -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];