Skip to content

Commit

Permalink
Please the clang with pass-by-reference
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed Jun 16, 2024
1 parent 65b284d commit 0d6eb29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ class game
bool debug_pathfinding = false; // NOLINT(cata-serialize)

//Ugly kludge to pass info to tile overmaps
npc *follower_path_to_show = nullptr;
npc *follower_path_to_show = nullptr; // NOLINT(cata-serialize)

/* tile overlays */
// Toggle all other overlays off and flip the given overlay on/off.
Expand Down
9 changes: 5 additions & 4 deletions src/overmap_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ static void draw_ascii(
const catacurses::window &w, const tripoint_abs_omt &center,
const tripoint_abs_omt &orig, bool blink, bool show_explored, bool /* fast_scroll */,
input_context * /* inp_ctxt */, const draw_data_t &data,
std::vector<tripoint_abs_omt> display_path )
const std::vector<tripoint_abs_omt> &display_path )
{

const int om_map_width = OVERMAP_WINDOW_WIDTH;
Expand Down Expand Up @@ -691,7 +691,7 @@ static void draw_ascii(
followers.push_back( npc_to_add );
}
if( !display_path.empty() ) {
for( auto &elem : display_path ) {
for( const tripoint_abs_omt &elem : display_path ) {
npc_path_route.insert( elem );
}
}
Expand Down Expand Up @@ -1263,7 +1263,8 @@ tiles_redraw_info redraw_info;
static void draw(
ui_adaptor &ui, const tripoint_abs_omt &center, const tripoint_abs_omt &orig,
bool blink, bool show_explored, bool fast_scroll,
input_context *inp_ctxt, const draw_data_t &data, std::vector<tripoint_abs_omt> display_path )
input_context *inp_ctxt, const draw_data_t &data,
const std::vector<tripoint_abs_omt> &display_path )
{
draw_om_sidebar( ui, g->w_omlegend, center, orig, blink, fast_scroll, inp_ctxt, data );
#if defined( TILES )
Expand Down Expand Up @@ -2080,7 +2081,7 @@ void ui::omap::display()
}

void ui::omap::display_npc_path( tripoint_abs_omt starting_pos,
std::vector<tripoint_abs_omt> display_path )
const std::vector<tripoint_abs_omt> &display_path )
{
overmap_ui::display( starting_pos, overmap_ui::draw_data_t(), display_path );
}
Expand Down
3 changes: 2 additions & 1 deletion src/overmap_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ void display();
/**
* Display overmap centered at the given NPC's position and visually move across their intended OMT path.
*/
void display_npc_path( tripoint_abs_omt starting_pos, std::vector<tripoint_abs_omt> display_path );
void display_npc_path( tripoint_abs_omt starting_pos,
const std::vector<tripoint_abs_omt> &display_path );
/**
* Display overmap like with @ref display() and display hordes.
*/
Expand Down

0 comments on commit 0d6eb29

Please sign in to comment.