Skip to content

Commit

Permalink
Choose type of map_memory correctly
Browse files Browse the repository at this point in the history
Previously I was picking based on compile-time option, but it's possible
to use the tiles build without tiles.  That was broken; now it's fixed.

Fixes CleverRaven#27486.
  • Loading branch information
jbytheway committed Jan 17, 2019
1 parent c4294a6 commit 305c428
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/map.cpp
Expand Up @@ -1321,14 +1321,18 @@ uint8_t map::get_known_connections( const tripoint &p, int connect_group ) const
bool is_transparent =
ch.transparency_cache[p.x][p.y] > LIGHT_TRANSPARENCY_SOLID;
uint8_t val = 0;
auto const is_memorized =
[&]( const tripoint & q ) {
#ifdef TILES
return !g->u.get_memorized_tile( getabs( q ) ).tile.empty();
#else
return g->u.get_memorized_symbol( getabs( q ) );
#endif
};
std::function<bool( const tripoint & )> is_memorized;
if( use_tiles ) {
is_memorized =
[&]( const tripoint & q ) {
return !g->u.get_memorized_tile( getabs( q ) ).tile.empty();
};
} else {
is_memorized =
[&]( const tripoint & q ) {
return g->u.get_memorized_symbol( getabs( q ) );
};
}

// populate connection information
for( int i = 0; i < 4; ++i ) {
Expand Down

0 comments on commit 305c428

Please sign in to comment.