Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Repair Nanobots #3308

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
static const std::string flag_SAFE_FUEL_OFF( "SAFE_FUEL_OFF" );
static const std::string flag_SEALED( "SEALED" );
static const std::string flag_SEMITANGIBLE( "SEMITANGIBLE" );
static const std::string flag_SPLINT( "SPLINT" );

Check warning on line 203 in src/bionics.cpp

View workflow job for this annotation

GitHub Actions / build

Variable 'flag_SPLINT' declared but not used. [cata-unused-statics]

static const flag_str_id flag_BIONIC_FAULTY( "BIONIC_FAULTY" );
static const flag_str_id flag_BIONIC_GUN( "BIONIC_GUN" );
Expand Down Expand Up @@ -495,7 +495,7 @@
return cbm_list;
}

const std::map<item, bionic_id> npc::check_toggle_cbm()

Check warning on line 498 in src/bionics.cpp

View workflow job for this annotation

GitHub Actions / build

return type 'const std::map<item, bionic_id>' (aka 'const map<item, string_id<bionic_data>>') is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type]
{
std::map<item, bionic_id> res;
const float allowed_ratio = static_cast<int>( rules.cbm_reserve ) / 100.0f;
Expand Down Expand Up @@ -1673,6 +1673,12 @@
}
if( calendar::once_every( 2_minutes ) ) {
std::vector<bodypart_id> damaged_hp_parts;
for( const bodypart_id &bp : get_all_body_parts( true ) ) {
const int hp_cur = get_part_hp_cur( bp );
if( !is_limb_broken( bp ) && hp_cur < get_part_hp_max( bp ) ) {
damaged_hp_parts.push_back( bp );
}
}
if( !damaged_hp_parts.empty() ) {
// Essential parts are considered 10 HP lower than non-essential parts for the purpose of determining priority.
// I'd use the essential_value, but it's tied up in the heal_actor class of iuse_actor.
Expand Down
Loading