Yes, that’s the distance.
if( !ignore_sight ) {
// If the submap is one of the outermost submaps, assume that monsters are
// invisible there.
// When the map shifts because of the player moving (called from game::plmove),
// the player has still their *old* (not shifted) coordinates.
// That makes the submaps that have come into view visible (if the sight range
// is big enough).
if( gp.x == 0 || gp.y == 0 || gp.x + 1 == MAPSIZE || gp.y + 1 == MAPSIZE ) {
ignore_sight = true;
}
}
So basically this is a “feature”.