diff --git a/src/cata_tiles.cpp b/src/cata_tiles.cpp index 9e40cb41a262e..dc11f3da4cf7a 100644 --- a/src/cata_tiles.cpp +++ b/src/cata_tiles.cpp @@ -1294,6 +1294,9 @@ void cata_tiles::draw( const point &dest, const tripoint ¢er, int width, int formatted_text( text, catacurses::red, NORTH ) ); } } + if( !p.invisible[0] ) { + g->m.check_and_set_seen_cache( p.pos ); + } } } // tile overrides are already drawn in the previous code @@ -1353,8 +1356,9 @@ void cata_tiles::draw( const point &dest, const tripoint ¢er, int width, int would_apply_vision_effects( g->m.get_visibility( ch.visibility_cache[np.x][np.y], cache ) ); } //calling draw to memorize everything. + //bypass cache check in case we learn something new about the terrain's connections + draw_terrain( p, lighting, height_3d, invisible ); if( g->m.check_seen_cache( p ) ) { - draw_terrain( p, lighting, height_3d, invisible ); draw_furniture( p, lighting, height_3d, invisible ); draw_trap( p, lighting, height_3d, invisible ); draw_vpart( p, lighting, height_3d, invisible ); @@ -2181,6 +2185,8 @@ bool cata_tiles::draw_terrain( const tripoint &p, const lit_level ll, int &heigh int connect_group = 0; if( t.obj().connects( connect_group ) ) { get_connect_values( p, subtile, rotation, connect_group, {} ); + // re-memorize previously seen terrain in case new connections have been seen + g->m.set_memory_seen_cache_dirty( p ); } else { get_terrain_orientation( p, rotation, subtile, {}, invisible ); // do something to get other terrain orientation values diff --git a/src/game.cpp b/src/game.cpp index 76136a41b2ec6..6572fa29b119d 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -9398,6 +9398,7 @@ void game::place_player_overmap( const tripoint &om_dest ) m.clear_vehicle_cache( z ); m.clear_vehicle_list( z ); } + m.access_cache( get_levz() ).map_memory_seen_cache.reset(); // offset because load_map expects the coordinates of the top left corner, but the // player will be centered in the middle of the map. const tripoint map_om_pos( tripoint( 2 * om_dest.x, 2 * om_dest.y, @@ -10403,6 +10404,7 @@ void game::vertical_shift( const int z_after ) m.clear_vehicle_cache( z_before ); m.access_cache( z_before ).vehicle_list.clear(); m.access_cache( z_before ).zone_vehicles.clear(); + m.access_cache( z_before ).map_memory_seen_cache.reset(); m.set_transparency_cache_dirty( z_before ); m.set_outside_cache_dirty( z_before ); m.load( tripoint( get_levx(), get_levy(), z_after ), true );