Skip to content

Commit

Permalink
No bulletin boards or faction display
Browse files Browse the repository at this point in the history
Fix abandoning camps (remove them from player known list)
  • Loading branch information
RenechCDDA committed Apr 29, 2024
1 parent 13cb9dd commit 717e440
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/json/overmap/overmap_special/specials.json
Original file line number Diff line number Diff line change
Expand Up @@ -2080,7 +2080,7 @@
{ "point": [ 9, 6, 0 ], "overmap": "evac_center_10_north" },
{ "point": [ 5, 7, 0 ], "overmap": "evac_center_11_north" },
{ "point": [ 6, 7, 0 ], "overmap": "evac_center_12_north" },
{ "point": [ 7, 7, 0 ], "overmap": "evac_center_13_north" },
{ "point": [ 7, 7, 0 ], "overmap": "evac_center_13_north", "camp": "free_merchants", "camp_name": "Refugee Center" },
{ "point": [ 8, 7, 0 ], "overmap": "evac_center_14_north" },
{ "point": [ 9, 7, 0 ], "overmap": "evac_center_15_north" },
{ "point": [ 5, 8, 0 ], "overmap": "evac_center_16_north" },
Expand Down
4 changes: 4 additions & 0 deletions src/faction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,10 @@ void faction_manager::display() const
continue;
}
basecamp *temp_camp = *p;
if( temp_camp->get_owner() != player_character.get_faction()->id ) {
// Don't display NPC camps as ours
continue;
}
camps.push_back( temp_camp );
}
lore.clear();
Expand Down
5 changes: 4 additions & 1 deletion src/faction_camp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2169,14 +2169,17 @@ void basecamp::abandon_camp()
for( npc_ptr &guy : get_npcs_assigned() ) {
talk_function::stop_guard( *guy );
}
// We must send this message early, before the name is erased.
add_msg( m_info, _( "You abandon %s." ), name );
std::set<tripoint_abs_omt> &known_camps = get_player_character().camps;
known_camps.erase( omt_pos );
overmap_buffer.remove_camp( *this );
map &here = get_map();
const tripoint sm_pos = omt_to_sm_copy( omt_pos.raw() );
const tripoint ms_pos = sm_to_ms_copy( sm_pos );
// We cannot use bb_pos here, because bb_pos may be {0,0,0} if you haven't examined the bulletin board on camp ever.
// here.remove_submap_camp( here.getlocal( bb_pos ) );
here.remove_submap_camp( here.getlocal( ms_pos ) );
add_msg( m_info, _( "You abandon %s." ), name );
}

void basecamp::scan_pseudo_items()
Expand Down
5 changes: 5 additions & 0 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1977,6 +1977,11 @@ void iexamine::bulletin_board( Character &you, const tripoint &examp )
std::optional<basecamp *> bcp = overmap_buffer.find_camp( omt );
if( bcp ) {
basecamp *temp_camp = *bcp;
if( temp_camp->get_owner() != get_avatar().get_faction()->id ) {
you.add_msg_if_player( _( "You don't run this camp, the board is useless to you." ) );
return;
}

temp_camp->validate_bb_pos( here.getabs( examp ) );
temp_camp->validate_assignees();
temp_camp->validate_sort_points();
Expand Down

0 comments on commit 717e440

Please sign in to comment.