I have a question about this method: int TileEngine::calculateLine in file Battlescape\TileEngine.cpp:
First the code does this:
//passes through this point?
if (doVoxelCheck)
{
result = voxelCheck(Position(cx, cy, cz), excludeUnit, false, onlyVisible, excludeAllBut);
if (result != V_EMPTY)
{
if (trajectory)
{ // store the position of impact
trajectory->push_back(Position(cx, cy, cz));
}
return result;
}
}
Then later the code does this:
//check for xy diagonal intermediate voxel step
if (doVoxelCheck)
{
cx = x; cz = z; cy = y;
if (swap_xz) std::swap(cx, cz);
if (swap_xy) std::swap(cx, cy);
result = voxelCheck(Position(cx, cy, cz), excludeUnit, excludeAllUnits, onlyVisible, excludeAllBut);
if (result != V_EMPTY)
{
if (trajectory != 0)
{ // store the position of impact
trajectory->push_back(Position(cx, cy, cz));
}
return result;
}
}
The first call looks like:
result = voxelCheck(Position(cx, cy, cz), excludeUnit, false, onlyVisible, excludeAllBut);
The second call looks like:
result = voxelCheck(Position(cx, cy, cz), excludeUnit, excludeAllUnits, onlyVisible, excludeAllBut);
Notice how the first call has a "false" parameter.
Is this intentional or is this a bug ?
If it's intentional why does the first call use a false parameter and the others ExcludeAllUnits ?