From 0d6eb29a4efbd30b0d792eab1ab0b538747820d1 Mon Sep 17 00:00:00 2001 From: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com> Date: Sun, 16 Jun 2024 14:41:24 -0400 Subject: [PATCH] Please the clang with pass-by-reference --- src/game.h | 2 +- src/overmap_ui.cpp | 9 +++++---- src/overmap_ui.h | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/game.h b/src/game.h index f16082351f532..ce4150f77f266 100644 --- a/src/game.h +++ b/src/game.h @@ -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. diff --git a/src/overmap_ui.cpp b/src/overmap_ui.cpp index bb6cde41ba89b..95bab8ccae9b8 100644 --- a/src/overmap_ui.cpp +++ b/src/overmap_ui.cpp @@ -539,7 +539,7 @@ static void draw_ascii( const catacurses::window &w, const tripoint_abs_omt ¢er, const tripoint_abs_omt &orig, bool blink, bool show_explored, bool /* fast_scroll */, input_context * /* inp_ctxt */, const draw_data_t &data, - std::vector display_path ) + const std::vector &display_path ) { const int om_map_width = OVERMAP_WINDOW_WIDTH; @@ -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 ); } } @@ -1263,7 +1263,8 @@ tiles_redraw_info redraw_info; static void draw( ui_adaptor &ui, const tripoint_abs_omt ¢er, const tripoint_abs_omt &orig, bool blink, bool show_explored, bool fast_scroll, - input_context *inp_ctxt, const draw_data_t &data, std::vector display_path ) + input_context *inp_ctxt, const draw_data_t &data, + const std::vector &display_path ) { draw_om_sidebar( ui, g->w_omlegend, center, orig, blink, fast_scroll, inp_ctxt, data ); #if defined( TILES ) @@ -2080,7 +2081,7 @@ void ui::omap::display() } void ui::omap::display_npc_path( tripoint_abs_omt starting_pos, - std::vector display_path ) + const std::vector &display_path ) { overmap_ui::display( starting_pos, overmap_ui::draw_data_t(), display_path ); } diff --git a/src/overmap_ui.h b/src/overmap_ui.h index d94dd35511be3..15633bd7563bd 100644 --- a/src/overmap_ui.h +++ b/src/overmap_ui.h @@ -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 display_path ); +void display_npc_path( tripoint_abs_omt starting_pos, + const std::vector &display_path ); /** * Display overmap like with @ref display() and display hordes. */