spring/spring — pull request #127 by rlcevg (2014-09-01 14:02:25+00:00)
Title: Fix return-type and value of Pathing::GetApproximateLength

Fix changes generation of this not very useful code:
```
EXPORT(float) bridged_Pathing_getApproximateLength(int skirmishAIId, float* start_posF3, float* end_posF3, int pathType, float goalRadius) {

struct SGetApproximateLengthPathCommand commandData;
int internal_ret;
commandData.start_posF3 = start_posF3;
commandData.end_posF3 = end_posF3;
commandData.pathType = pathType;
commandData.goalRadius = goalRadius;

internal_ret = id_clb[skirmishAIId]->Engine_handleCommand(skirmishAIId, COMMAND_TO_ID_ENGINE, -1, COMMAND_PATH_GET_APPROXIMATE_LENGTH, &commandData);

internal_ret = commandData.ret_approximatePathLength;
if (internal_ret == 0) {
internal_ret = commandData.ret_approximatePathLength;
} else {
internal_ret = 0;
}
return internal_ret;
}
```
to more meaningful code:
```
EXPORT(float) bridged_Pathing_getApproximateLength(int skirmishAIId, float* start_posF3, float* end_posF3, int pathType, float goalRadius) {

struct SGetApproximateLengthPathCommand commandData;
int internal_ret;
commandData.start_posF3 = start_posF3;
commandData.end_posF3 = end_posF3;
commandData.pathType = pathType;
commandData.goalRadius = goalRadius;

internal_ret = id_clb[skirmishAIId]->Engine_handleCommand(skirmishAIId, COMMAND_TO_ID_ENGINE, -1, COMMAND_PATH_GET_APPROXIMATE_LENGTH, &commandData);

if (internal_ret == 0) {
return commandData.ret_approximatePathLength;
} else {
return (float)0;
}
}
```
That way function will return proper value instead of always 0.

PS: Strange behavior noticed. If start point = end point then length is always 10. Not a big problem and its anyway ApproximateLength.