Skip to content

Commit

Permalink
fix: clang-tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Dec 18, 2023
1 parent a80bf8c commit 7b1c3ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1542,23 +1542,23 @@ void caused_effect::load( const JsonObject &jo )
}
assign( jo, "inherit_duration", inherit_duration );
if( jo.has_member( "duration" ) && jo.has_member( "inherit_duration" ) ) {
jo.throw_error( "\"duration\" and \"inherit_duration\" can't both be set at the same time." );
jo.throw_error( R"("duration" and "inherit_duration" can't both be set at the same time.)" );
}

if( assign( jo, "intensity", intensity ) ) {
inherit_intensity = false;
}
assign( jo, "inherit_intensity", inherit_intensity );
if( jo.has_member( "intensity" ) && jo.has_member( "inherit_intensity" ) ) {
jo.throw_error( "\"intensity\" and \"inherit_intensity\" can't both be set at the same time." );
jo.throw_error( R"("intensity" and "inherit_intensity" can't both be set at the same time.)" );
}

if( assign( jo, "body_part", bp ) ) {
inherit_body_part = false;
}
assign( jo, "inherit_body_part", inherit_body_part );
if( jo.has_member( "intensity" ) && jo.has_member( "inherit_intensity" ) ) {
jo.throw_error( "\"body_part\" and \"inherit_body_part\" can't both be set at the same time." );
jo.throw_error( R"("body_part" and "inherit_body_part" can't both be set at the same time.)" );
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct caused_effect {
bodypart_str_id bp = bodypart_str_id::NULL_ID();
bool inherit_body_part = true;

void load_decay( const JsonObject &obj );
void load_decay( const JsonObject &jo );

auto tie() const {
return std::tie( type, intensity_requirement, allow_on_decay, allow_on_remove,
Expand All @@ -75,7 +75,7 @@ struct caused_effect {
return tie() == rhs.tie();
}
private:
void load( const JsonObject &obj );
void load( const JsonObject &jo );
};


Expand Down
1 change: 0 additions & 1 deletion src/memorial_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "type_id.h"
#include "units.h"

static const efftype_id effect_adrenaline( "adrenaline" );
static const efftype_id effect_datura( "datura" );
static const efftype_id effect_drunk( "drunk" );
static const efftype_id effect_jetinjector( "jetinjector" );
Expand Down
8 changes: 4 additions & 4 deletions tests/effects_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@ TEST_CASE( "Effect body part switching and inheritance on decay works as expecte
dummy.process_effects();
CHECK( !dummy.has_effect( effect_test_juggling_l1 ) );
CHECK( dummy.has_effect( effect_test_juggling_r1 ) );
dummy.get_effect( effect_test_juggling_r1 ).get_bp() == body_part_hand_r;
// dummy.get_effect( effect_test_juggling_r1 ).get_bp() == body_part_hand_r;

dummy.process_effects();
CHECK( !dummy.has_effect( effect_test_juggling_r1 ) );
CHECK( dummy.has_effect( effect_test_juggling_r2 ) );
dummy.get_effect( effect_test_juggling_r2 ).get_bp() == body_part_hand_r;
// dummy.get_effect( effect_test_juggling_r2 ).get_bp() == body_part_hand_r;

dummy.process_effects();
CHECK( !dummy.has_effect( effect_test_juggling_r2 ) );
CHECK( dummy.has_effect( effect_test_juggling_l2 ) );
dummy.get_effect( effect_test_juggling_l2 ).get_bp() == body_part_hand_l;
// dummy.get_effect( effect_test_juggling_l2 ).get_bp() == body_part_hand_l;

dummy.process_effects();
CHECK( !dummy.has_effect( effect_test_juggling_l2 ) );
CHECK( dummy.has_effect( effect_test_juggling_l1 ) );
dummy.get_effect( effect_test_juggling_l1 ).get_bp() == body_part_hand_l;
// dummy.get_effect( effect_test_juggling_l1 ).get_bp() == body_part_hand_l;
}

0 comments on commit 7b1c3ad

Please sign in to comment.