From 8ad705f12854f3bc8ed9f4f9afa5bba93e5a56be Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Wed, 8 Apr 2020 12:22:41 -0400 Subject: [PATCH] Misc clang-tidy fixes --- src/newcharacter.cpp | 4 +++- src/vehicle_move.cpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/newcharacter.cpp b/src/newcharacter.cpp index cce5aa7572cca..e8d1b626dac8a 100644 --- a/src/newcharacter.cpp +++ b/src/newcharacter.cpp @@ -1533,10 +1533,11 @@ tab_direction set_profession( avatar &u, points_left &points, draw_sorting_indicator( w_sorting, ctxt, profession_sorter ); werase( w_genderswap ); - //~ Gender switch message. 1s - change key name, 2s - profession name. std::string g_switch_msg = u.male ? + //~ Gender switch message. 1s - change key name, 2s - profession name. _( "Press %1$s to switch " "to %2$s (female)." ) : + //~ Gender switch message. 1s - change key name, 2s - profession name. _( "Press %1$s to switch " "to %2$s (male)." ); fold_and_print( w_genderswap, point_zero, ( TERMX / 2 ), c_light_gray, g_switch_msg.c_str(), @@ -2444,6 +2445,7 @@ tab_direction set_description( avatar &you, const bool allow_reroll, ctxt.get_desc( "CHOOSE_LOCATION" ) ); const int prompt_offset = utf8_width( location_prompt ); werase( w_location ); + // NOLINTNEXTLINE(cata-use-named-point-constants) fold_and_print( w_location, point( 0, 1 ), ( TERMX / 2 ), c_light_gray, location_prompt ); mvwprintz( w_location, point( prompt_offset - 10, 0 ), c_light_gray, _( "Starting location:" ) ); // ::find will return empty location if id was not found. Debug msg will be printed too. diff --git a/src/vehicle_move.cpp b/src/vehicle_move.cpp index 9ff5798ec3600..739dbe443ad7c 100644 --- a/src/vehicle_move.cpp +++ b/src/vehicle_move.cpp @@ -733,6 +733,10 @@ veh_collision vehicle::part_collision( int part, const tripoint &p, } else if( ret.type == veh_coll_body ) { int dam = obj_dmg * dmg_mod / 100; + // We know critter is set for this type. Assert to inform static + // analysis. + assert( critter ); + // No blood from hallucinations if( !critter->is_hallucination() ) { if( part_flag( ret.part, "SHARP" ) ) {