Skip to content

Commit 070d354

Browse files
committed
Satisfied clang-tidy
1 parent e2e8af4 commit 070d354

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/avatar.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ void avatar::set_active_mission( mission &cur_mission )
345345
}
346346
}
347347

348-
void avatar::set_active_point_of_interest( point_of_interest active_point_of_interest )
348+
void avatar::set_active_point_of_interest( const point_of_interest &active_point_of_interest )
349349
{
350-
for( auto iter : points_of_interest ) {
350+
for( const point_of_interest iter : points_of_interest ) {
351351
// It's really sufficient to only check the position as used...
352352
if( iter.pos == active_point_of_interest.pos &&
353353
iter.text == active_point_of_interest.text ) {
@@ -428,7 +428,7 @@ void avatar::remove_active_mission( mission &cur_mission )
428428
}
429429
}
430430

431-
void avatar::add_point_of_interest( point_of_interest new_point_of_interest )
431+
void avatar::add_point_of_interest( const point_of_interest &new_point_of_interest )
432432
{
433433
for( point_of_interest &existing_point_of_interest : points_of_interest ) {
434434
if( new_point_of_interest.pos == existing_point_of_interest.pos ) {

src/avatar.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class avatar : public Character
186186
/**
187187
* Set which point of interest is active. The point of interest must be listed in @ref points_of_interest.
188188
*/
189-
void set_active_point_of_interest( point_of_interest active_point_of_interest );
189+
void set_active_point_of_interest( const point_of_interest &active_point_of_interest );
190190
/**
191191
* Called when a mission has been assigned to the player.
192192
*/
@@ -206,7 +206,7 @@ class avatar : public Character
206206
/**
207207
* Despite the name, this operation also makes an existing point of interest active.
208208
*/
209-
void add_point_of_interest( point_of_interest new_point_of_interest );
209+
void add_point_of_interest( const point_of_interest &new_point_of_interest );
210210
void delete_point_of_interest( tripoint_abs_omt pos );
211211

212212
//return avatar diary

src/mission_ui.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class mission_ui_impl : public cataimgui::window
7676
bool &need_adjust ) const;
7777
void draw_selected_description( std::vector<mission *> missions, int &selected_mission );
7878
void draw_selected_description( std::vector<point_of_interest> points_of_interest,
79-
int &selected_mission );
79+
const int &selected_mission );
8080

8181
mission_ui_tab_enum selected_tab = mission_ui_tab_enum::ACTIVE;
8282
mission_ui_tab_enum switch_tab = mission_ui_tab_enum::num_tabs;
@@ -246,7 +246,7 @@ void mission_ui_impl::draw_controls()
246246
{ mission_ui_tab_enum::ACTIVE, translate_marker( "You have no active missions!" ) },
247247
{ mission_ui_tab_enum::COMPLETED, translate_marker( "You haven't completed any missions!" ) },
248248
{ mission_ui_tab_enum::FAILED, translate_marker( "You haven't failed any missions!" ) },
249-
{mission_ui_tab_enum::POINTS_OF_INTEREST, translate_marker( "You don't have any points of interest. Add those from the overmap." )}
249+
{mission_ui_tab_enum::POINTS_OF_INTEREST, translate_marker( "You don't have any points of interest. Add those from the overmap." )}
250250
};
251251
ImGui::TextWrapped( "%s", nope.at( selected_tab ).c_str() );
252252
return;
@@ -441,7 +441,7 @@ void mission_ui_impl::draw_selected_description( std::vector<mission *> missions
441441
}
442442

443443
void mission_ui_impl::draw_selected_description( std::vector<point_of_interest> points_of_interest,
444-
int &selected_mission )
444+
const int &selected_mission )
445445
{
446446
point_of_interest selected_point_of_interest = points_of_interest[selected_mission];
447447
ImGui::TextWrapped( _( "Point of Interest: %s" ), selected_point_of_interest.text.c_str() );

0 commit comments

Comments
 (0)