if (calculateLineVoxel(originVoxel, targetVoxel, false, &trajectory, unit, unit) == V_EMPTY)
needs to be changed to:
if (calculateLineVoxel(originVoxel, targetVoxel, true, &trajectory, unit, unit) == V_EMPTY)
Otherwise only the tile where the grenade lands will be considered dangerous.
Reason:
calculateLineVoxel, when called with storeTrajectory = false will only return a trajectory when something would block the line. But in this case we want to see whether the line is free.
So the trajectory-size was always 0 on the tiles that were empty.
When it is called with "true", it works. Alternatively you can leave it at "false" and set the tile as dangerous when the trajectory-size is 0 because that means that nothing would be in the way of the blast-wave.