As reported in #6116, the viewpoint polygon drawn on the minimap sometimes appears to be out of place. This is particularly noticeably on maps that have no visible water (e.g. Skirmish map "Vesuvius (6)").
As discovered, this appears to be because (as of rP16482) the polygon is drawn from the intersection of the camera's view frustum and the water plane, as depicted here:
As you can see: there is some difference between where the view intersects the ground and where it intersects the water plane, causing the visual disconnect (and also demonstrating why maps with no visible water suffer from this the most: the water planes in those maps are most likely at the default position for new maps - as far from the camera as the co-ordinate system allows).
(Prior to that commit, the intersected plane was at a fixed height regardless of the map's terrain.)
The solution used in this revision is to determine the height of the terrain in the very centre of the camera's viewpoint, and imagine a plane exists at that point to intersect the camera's view with:
This is not a perfect solution - particularly on maps with steep hills - as the edges of the polygon will still be slightly inaccurate, but it should hopefully be "close enough"(TM).