remove unused variables (nfc) (#61997)

This commit is contained in:
RipleyTom 2022-11-01 00:04:04 +01:00 committed by GitHub
parent 2b50548882
commit 1264425026
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 1 additions and 17 deletions

View File

@ -10928,7 +10928,6 @@ void game::fling_creature( Creature *c, const units::angle &dir, float flvel, bo
// Target creature shouldn't be grabbed if thrown
c->remove_effect( effect_grabbed );
int steps = 0;
bool thru = true;
const bool is_u = c == &u;
// Don't animate critters getting bashed if animations are off
@ -11014,7 +11013,6 @@ void game::fling_creature( Creature *c, const units::angle &dir, float flvel, bo
break;
}
range--;
steps++;
if( animate && ( seen || u.sees( *c ) ) ) {
invalidate_main_ui_adaptor();
inp_mngr.pump_events();

View File

@ -290,12 +290,10 @@ simple_path<tripoint_abs_omt> find_overmap_path( const tripoint_abs_omt &source,
known_nodes.emplace( start, navigation_node{0, 0, -1, start_score.allow_z_change} );
open_set.push( scored_address{ start, 0 } );
const point_abs_omt source_point = source.xy();
int search_count = 0;
constexpr int max_search_count = 100000;
while( !open_set.empty() ) {
const node_address cur_addr = open_set.top().addr;
open_set.pop();
search_count++;
const tripoint_abs_omt cur_point = cur_addr.to_tripoint( source );
if( cur_point == dest ) {
node_address addr = cur_addr;

View File

@ -962,12 +962,10 @@ cata::optional<std::vector<navigation_step>> vehicle::autodrive_controller::comp
veh_pos.raw().xy(), to_orientation( driven_veh.face.dir() ) );
known_nodes.emplace( start, make_start_node( start, driven_veh ) );
open_set.push( scored_address{ start, 0 } );
int search_count = 0;
std::vector<std::pair<node_address, navigation_node>> next_nodes;
while( !open_set.empty() ) {
const node_address cur_addr = open_set.top().addr;
open_set.pop();
search_count++;
const navigation_node &cur_node = known_nodes[cur_addr];
if( cur_node.is_goal ) {
node_address addr = cur_addr;

View File

@ -819,14 +819,11 @@ std::map<int, inclusive_rectangle<point>> worldfactory::draw_mod_list( const cat
const int wwidth = getmaxx( w ) - 1 - 3; // border (1) + ">> " (3)
unsigned int iNum = 0;
int index = 0;
bool bKeepIter = false;
int iCatBeforeCursor = 0;
for( size_t i = 0; i <= iActive; i++ ) {
if( !mSortCategory[i].empty() ) {
iActive++;
iCatBeforeCursor++;
}
}
@ -841,7 +838,7 @@ std::map<int, inclusive_rectangle<point>> worldfactory::draw_mod_list( const cat
}
int larger = ( iMaxRows > static_cast<int>( iModNum ) ) ? static_cast<int>( iModNum ) : iMaxRows;
for( auto iter = mods.begin(); iter != mods.end(); ++index ) {
for( auto iter = mods.begin(); iter != mods.end(); ) {
if( iNum >= static_cast<size_t>( start ) && iNum < static_cast<size_t>( start ) + larger ) {
if( !mSortCategory[iNum].empty() ) {
bKeepIter = true;

View File

@ -471,7 +471,6 @@ TEST_CASE( "colony insert and erase", "[colony]" )
++count;
}
}
int count2 = 0;
for( cata::colony<int>::iterator it = test_colony.begin(); it != test_colony.end(); ) {
if( ( xor_rand() & 7 ) == 0 ) {
it = test_colony.erase( it );
@ -479,7 +478,6 @@ TEST_CASE( "colony insert and erase", "[colony]" )
} else {
++it;
}
++count2;
}
}

View File

@ -1149,9 +1149,7 @@ TEST_CASE( "partial_proficiency_mitigation", "[crafting][proficiency]" )
int unmitigated_time_taken = test_recipe.batch_time( tester, 1, 1, 0 );
WHEN( "player acquires partial proficiency" ) {
int np = 0;
for( const proficiency_id &prof : test_recipe.used_proficiencies() ) {
np++;
tester.set_proficiency_practice( prof, tester.proficiency_training_needed( prof ) / 2 );
}
int mitigated_time_taken = test_recipe.batch_time( tester, 1, 1, 0 );

View File

@ -41,7 +41,6 @@ static float get_damage_vs_target( const std::string &target_id )
frag.proj = proj;
int damaging_hits = 0;
int non_damaging_hits = 0;
int damage_taken = 0;
tripoint monster_position( 30, 30, 0 );
clear_map_and_put_player_underground();
@ -56,8 +55,6 @@ static float get_damage_vs_target( const std::string &target_id )
if( frag.dealt_dam.total_damage() > 0 ) {
damaging_hits++;
damage_taken += frag.dealt_dam.total_damage();
} else {
non_damaging_hits++;
}
}
return static_cast<float>( damage_taken ) / static_cast<float>( damaging_hits );