Lets not use `goto` when a simple `return` suffices
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4737 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
11c2f3547e
commit
406ab54031
14
src/fpath.c
14
src/fpath.c
|
@ -462,8 +462,7 @@ static FPATH_RETVAL fpathGatewayRoute(DROID* psDroid, SDWORD routeMode, SDWORD s
|
||||||
{
|
{
|
||||||
// routing hasn't finished yet
|
// routing hasn't finished yet
|
||||||
objTrace(LOG_MOVEMENT, psDroid->id, "fpathGatewayRoute: Reschedule");
|
objTrace(LOG_MOVEMENT, psDroid->id, "fpathGatewayRoute: Reschedule");
|
||||||
retval = FPR_WAIT;
|
return FPR_WAIT;
|
||||||
goto exit;
|
|
||||||
}
|
}
|
||||||
routeMode = ASR_NEWROUTE;
|
routeMode = ASR_NEWROUTE;
|
||||||
|
|
||||||
|
@ -472,8 +471,7 @@ static FPATH_RETVAL fpathGatewayRoute(DROID* psDroid, SDWORD routeMode, SDWORD s
|
||||||
{
|
{
|
||||||
// found a blocking wall - route to that
|
// found a blocking wall - route to that
|
||||||
objTrace(LOG_MOVEMENT, psDroid->id, "fpathGatewayRoute: Got blocking wall");
|
objTrace(LOG_MOVEMENT, psDroid->id, "fpathGatewayRoute: Got blocking wall");
|
||||||
retval = FPR_OK;
|
return FPR_OK;
|
||||||
goto exit;
|
|
||||||
}
|
}
|
||||||
else if (asret == ASR_NEAREST)
|
else if (asret == ASR_NEAREST)
|
||||||
{
|
{
|
||||||
|
@ -484,15 +482,13 @@ static FPATH_RETVAL fpathGatewayRoute(DROID* psDroid, SDWORD routeMode, SDWORD s
|
||||||
psMoveCntl->numPoints = 0;
|
psMoveCntl->numPoints = 0;
|
||||||
fpathAppendRoute(psMoveCntl, &sAStarRoute);
|
fpathAppendRoute(psMoveCntl, &sAStarRoute);
|
||||||
}
|
}
|
||||||
retval = FPR_OK;
|
return FPR_OK;
|
||||||
goto exit;
|
|
||||||
}
|
}
|
||||||
else if (asret == ASR_FAILED)
|
else if (asret == ASR_FAILED)
|
||||||
{
|
{
|
||||||
// all routing was in one zone - can't retry
|
// all routing was in one zone - can't retry
|
||||||
objTrace(LOG_MOVEMENT, psDroid->id, "fpathGatewayRoute: Failed route in same zone");
|
objTrace(LOG_MOVEMENT, psDroid->id, "fpathGatewayRoute: Failed route in same zone");
|
||||||
retval = FPR_FAILED;
|
return FPR_FAILED;
|
||||||
goto exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
linkx = gwx;
|
linkx = gwx;
|
||||||
|
@ -508,8 +504,6 @@ static FPATH_RETVAL fpathGatewayRoute(DROID* psDroid, SDWORD routeMode, SDWORD s
|
||||||
fpathAppendRoute(psMoveCntl, &sAStarRoute);
|
fpathAppendRoute(psMoveCntl, &sAStarRoute);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue