diff --git a/src/basecamp.cpp b/src/basecamp.cpp index a7db03fd5504b..fd109a964e380 100644 --- a/src/basecamp.cpp +++ b/src/basecamp.cpp @@ -147,7 +147,7 @@ expansion_data basecamp::parse_expansion( const std::string &terrain, expansion_data e; size_t last_bar = terrain.find_last_of( '_' ); e.type = terrain.substr( base_camps::prefix_len, last_bar - base_camps::prefix_len ); - e.cur_level = std::stoi( terrain.substr( last_bar + 1 ) ); + e.cur_level = std::stoi( "0" + terrain.substr( last_bar + 1 ) ); e.pos = new_pos; return e; } diff --git a/src/faction_camp.cpp b/src/faction_camp.cpp index 554a67add9e3e..a689b83d46a77 100644 --- a/src/faction_camp.cpp +++ b/src/faction_camp.cpp @@ -683,8 +683,14 @@ void talk_function::start_camp( npc &p ) for( const auto &om_near : om_building_region( omt_pos, 3 ) ) { const oter_id &om_type = oter_id( om_near.first ); if( is_ot_match( "faction_base", om_type, ot_match_type::contains ) ) { - popup( _( "You are too close to another camp!" ) ); - return; + tripoint_abs_omt const &building_omt_pos = om_near.second; + std::vector const &camps = overmap_buffer.get_om_global( building_omt_pos ).om->camps; + if( std::any_of( camps.cbegin(), camps.cend(), [&building_omt_pos]( const basecamp & camp ) { + return camp.camp_omt_pos() == building_omt_pos; + } ) ) { + popup( _( "You are too close to another camp!" ) ); + return; + } } } const recipe &making = camp_type.obj();