Skip to content

Commit

Permalink
demanded changes + correction
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrikLundell committed Jun 4, 2024
1 parent 6ae834d commit 9f7e619
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8370,7 +8370,7 @@ void map::loadn( const point &grid, bool update_vehicles )
set_floor_cache_dirty( z );
set_pathfinding_cache_dirty( z );
tmpsub = MAPBUFFER.lookup_submap( pos );
setsubmap( get_nonant( { grid.x, grid.y, z } ), tmpsub );
setsubmap( get_nonant( { grid, z } ), tmpsub );
if( !tmpsub->active_items.empty() ) {
submaps_with_active_items_dirty.emplace( pos );
}
Expand Down
8 changes: 3 additions & 5 deletions src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@
#include "weighted_list.h"
#include "creature_tracker.h"

static furn_id f_null;

static const furn_str_id furn_f_bed( "f_bed" );
static const furn_str_id furn_f_console( "f_console" );
static const furn_str_id furn_f_counter( "f_counter" );
Expand Down Expand Up @@ -297,9 +295,9 @@ void map::generate( const tripoint_abs_omt &p, const time_point &when, bool save

// Not sure if we actually have to check all submaps.
const bool any_missing = MAPBUFFER.lookup_submap( p_sm ) == nullptr ||
MAPBUFFER.lookup_submap( p_sm + point{ 1, 0 } ) == nullptr ||
MAPBUFFER.lookup_submap( p_sm + point{ 0, 1 } ) == nullptr ||
MAPBUFFER.lookup_submap( p_sm + point{ 1, 1 } ) == nullptr;
MAPBUFFER.lookup_submap( p_sm + point_east ) == nullptr ||
MAPBUFFER.lookup_submap( p_sm + point_south_east ) == nullptr ||
MAPBUFFER.lookup_submap( p_sm + point_south ) == nullptr;

mapgendata dat( { p.xy(), gridz}, *this, density, when, nullptr );
if( ( !save_results || any_missing ) &&
Expand Down
9 changes: 4 additions & 5 deletions src/submap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,10 @@ void submap::merge_submaps( submap *copy_from, bool copy_from_is_overlay )
for( const submap::cosmetic_t &cos : copy_from->cosmetics ) {
bool found = false;

for( size_t i = 0; i < this->cosmetics.size(); ++i ) {
if( this->cosmetics[i].pos == cos.pos &&
this->cosmetics[i].type == cos.type ) {
if( this->cosmetics[i].str == cos.str || !copy_from_is_overlay ) {
this->cosmetics[i].str = cos.str;
for( submap::cosmetic_t &cosmetic : this->cosmetics ) {
if( cosmetic.pos == cos.pos && cosmetic.type == cos.type ) {
if( copy_from_is_overlay ) {
cosmetic.str = cos.str;
}
found = true;
break;
Expand Down

0 comments on commit 9f7e619

Please sign in to comment.