Skip to content

Commit

Permalink
Remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
Coolthulhu committed Nov 16, 2023
1 parent 25ff9f2 commit 4b5f240
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
15 changes: 0 additions & 15 deletions src/effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,15 +1409,6 @@ void load_effect_type( const JsonObject &jo )
}
}

if( jo.has_array( "effects_on_turn" ) ) {
JsonArray jarr = jo.get_array( "effects_on_turn" );
for( JsonObject jo_inner : jarr ) {
caused_effect new_caused_effect;
new_caused_effect.load_interval( jo_inner );
new_etype.effects_on_turn.insert( new_caused_effect );
}
}

if( jo.has_array( "effects_on_remove" ) ) {
JsonArray jarr = jo.get_array( "effects_on_remove" );
for( JsonObject jo_decay : jarr ) {
Expand Down Expand Up @@ -1522,12 +1513,6 @@ std::string texitify_healing_power( const int power )
return "";
}

void caused_effect::load_interval( const JsonObject &jo )
{
assign( jo, "interval", interval );
load( jo );
}

void caused_effect::load_decay( const JsonObject &jo )
{
assign( jo, "allow_on_decay", allow_on_decay );
Expand Down
12 changes: 1 addition & 11 deletions src/effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ enum effect_rating {
struct caused_effect {
public:
efftype_id type;
/**
* How many turns between applications? Unused for decay trigger.
* Counted from effect birthday. TODO: Count from turn requirements were met.
*/
time_duration interval = 1_turns;
/** Minimum parent effect intensity to apply the new effect. */
int intensity_requirement = 0;
/** If false, prevents application if the trigger was parent decaying to 0 duration. */
Expand All @@ -66,11 +61,10 @@ struct caused_effect {
/** If true, intensity field is ignored and parent effect intensity is copied. */
bool inherit_intensity = false;

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

Check failure on line 64 in src/effect.h

View workflow job for this annotation

GitHub Actions / build

function 'caused_effect::load_decay' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name,-warnings-as-errors]

auto tie() const {
return std::tie( type, interval, intensity_requirement, allow_on_decay, allow_on_remove,
return std::tie( type, intensity_requirement, allow_on_decay, allow_on_remove,
duration, inherit_duration, intensity, inherit_intensity );
}

Expand All @@ -84,9 +78,6 @@ struct caused_effect {
struct caused_effect_sort_less {
public:
bool operator()( const caused_effect &lhs, const caused_effect &rhs ) const {
if( lhs.interval != rhs.interval ) {
return lhs.interval < rhs.interval;
}
if( lhs.type != rhs.type ) {
return lhs.type < rhs.type;
}
Expand Down Expand Up @@ -223,7 +214,6 @@ class effect_type

morale_type morale;

cata::flat_set<caused_effect, caused_effect_sort_less> effects_on_turn;
std::vector<caused_effect> effects_on_remove;

/** Key tuple order is:("base_mods"/"scaling_mods", reduced: bool, type of mod: "STR", desired argument: "tick") */
Expand Down

0 comments on commit 4b5f240

Please sign in to comment.