From 9f7e61943070fb3615922ae072a1d319e1ccb019 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Tue, 4 Jun 2024 10:48:36 +0200 Subject: [PATCH] demanded changes + correction --- src/map.cpp | 2 +- src/mapgen.cpp | 8 +++----- src/submap.cpp | 9 ++++----- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index f01f4039c0e1d..695db07852f8c 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -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 ); } diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 52dbf76e2d191..ea2cdda621174 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -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" ); @@ -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 ) && diff --git a/src/submap.cpp b/src/submap.cpp index cbeade5077dfe..2f1e5d0f9e29c 100644 --- a/src/submap.cpp +++ b/src/submap.cpp @@ -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;