overmap &overmapbuffer::get( const int x, const int y )
{
    auto it = overmaps.find( point( x, y ) );
    if( it != overmaps.end() ) {
        return *(it->second);
    }
    // That constructor loads an existing overmap or creates a new one.
    std::unique_ptr<overmap> new_om( new overmap( x, y ) );
    overmap &result = *new_om;
    overmaps[ new_om->pos() ] = std::move( new_om );
    // Note: fix_mongroups might load other overmaps, so overmaps.back() is not
    // necessarily the overmap at (x,y)
    fix_mongroups( result );
    return result;
}
overmap &overmapbuffer::get( const int x, const int y )
{
    point const p {x, y};

    if (last_requested_overmap && last_requested_overmap->pos() == p) {
        return *last_requested_overmap;
    }

    auto const it = overmaps.find( p );
    if( it != overmaps.end() ) {
        return *(last_requested_overmap = it->second.get());
    }

    // That constructor loads an existing overmap or creates a new one.
    std::unique_ptr<overmap> new_om( new overmap( x, y ) );
    overmap &result = *new_om;
    overmaps[ new_om->pos() ] = std::move( new_om );
    // Note: fix_mongroups might load other overmaps, so overmaps.back() is not
    // necessarily the overmap at (x,y)
    fix_mongroups( result );

    last_requested_overmap = &result;
    return result;
}