Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
astyle

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
osuphobia and github-actions[bot] authored Dec 19, 2024
1 parent 83bd457 commit 1af0dd8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7819,7 +7819,7 @@ void Character::update_cached_mutations()
if( it == current_traits.end() ) {
for( auto &iter : cached_mutations ) {
if( ( are_opposite_traits( iter.first, mut ) || b_is_higher_trait_of_a( iter.first, mut )
|| are_same_type_traits( iter.first, mut ) ) && iter.second.corrupted > 0 ) {
|| are_same_type_traits( iter.first, mut ) ) && iter.second.corrupted > 0 ) {
--iter.second.corrupted;
if( my_mutations.count( mut ) ) {
--my_mutations[mut].corrupted;
Expand All @@ -7841,7 +7841,7 @@ void Character::update_cached_mutations()
|| are_same_type_traits( iter.first, mut ) ) {
++iter.second.corrupted;
if( my_mutations.count( mut ) ) {
++my_mutations[mut].corrupted;
++my_mutations[mut].corrupted;
}
if( iter.second.corrupted == 1 ) {
mutation_loss_effect( mut );
Expand Down
4 changes: 2 additions & 2 deletions src/mutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ void Character::unset_mutation( const trait_id &trait_ )
}
const mutation_branch &mut = *trait;
my_mutations.erase( iter );
auto exists = find( old_mutation_cache->mutations.begin(), old_mutation_cache->mutations.end(), trait_ );
auto exists = find( old_mutation_cache->mutations.begin(), old_mutation_cache->mutations.end(),
trait_ );
if( exists == old_mutation_cache->mutations.end() ) {
cached_mutations.erase( trait_ );
if( !mut.enchantments.empty() ) {
Expand Down Expand Up @@ -561,7 +562,6 @@ void Character::mutation_effect( const trait_id &mut, const bool worn_destroyed_
if( mut.obj().vanity ) {
return;
}

if( mut == trait_GLASSJAW ) {
recalc_hp();
}
Expand Down
1 change: 0 additions & 1 deletion src/savegame_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@ void Character::load( const JsonObject &data )
// As every time we add a mutation, we rebuild the enchantment cache, causing errors if
// we have invalid mutations.
recalculate_enchantment_cache();

recalculate_size();

data.read( "my_bionics", *my_bionics );
Expand Down

0 comments on commit 1af0dd8

Please sign in to comment.