There's a bug with forced attacks on a moving target that moves out of vision range.
Usually the logic is in UnitAI, in this case combat approaching, where in Timer we decide if we should abandon the chase (for forced commands we don't want to stop chasing; even if he goes out of vision range we want to follow the path to where we saw him last) and in MoveCompleted we decide if we're in range or need to move closer to the target or have to give up.
However, in UnitMotion, if we're out of waypoints, i.e. done with the approach, there's a piece of code that tests if the target is moving and if so to move to target range, i.e. get a new path. So it decides what to do itself rather than sending a move completed message to UnitAI. (UnitAI stays in the approach Timer.)
The particular problem here is that the UnitMotion code doesn't take into account visibility (UnitAI does), so units will continue to chase after the target, even in the fog of war and shroud of darkness, as long as the target continues to move.
I don't know why the code's there, but it's wrong and seems out of place.