Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Kribylet committed Sep 29, 2021
1 parent 6c78490 commit f6fe965
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
8 changes: 4 additions & 4 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8952,7 +8952,7 @@ void Character::process_effects()

// Apply new effects from effect->effect chains
while( !scheduled_effects.empty() ) {
const auto& effect = scheduled_effects.front();
const auto &effect = scheduled_effects.front();

add_effect( effect_source::empty(),
effect.eff_id,
Expand All @@ -8967,11 +8967,11 @@ void Character::process_effects()
}

// Perform immediate effect removals
while ( !terminating_effects.empty() ) {
while( !terminating_effects.empty() ) {

const auto& effect = terminating_effects.front();
const auto &effect = terminating_effects.front();

remove_effect(effect.eff_id, effect.bp);
remove_effect( effect.eff_id, effect.bp );

terminating_effects.pop();
}
Expand Down
24 changes: 12 additions & 12 deletions src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Creature &Creature::operator=( Creature && ) noexcept = default;
Creature::~Creature() = default;


std::queue<scheduled_effect> Creature::scheduled_effects = std::queue<scheduled_effect>{};
std::queue<terminating_effect> Creature::terminating_effects = std::queue<terminating_effect>{};
std::queue<scheduled_effect> Creature::scheduled_effects = std::queue<scheduled_effect> {};
std::queue<terminating_effect> Creature::terminating_effects = std::queue<terminating_effect> {};

tripoint Creature::pos() const
{
Expand Down Expand Up @@ -1331,25 +1331,25 @@ void Creature::add_effect( const effect_source &source, const efftype_id &eff_id
deferred );
}

void Creature::schedule_effect(const effect &eff, bool force, bool deferred )
void Creature::schedule_effect( const effect &eff, bool force, bool deferred )
{
scheduled_effects.push(scheduled_effect{eff.get_id(), eff.get_duration(), eff.get_bp(),
eff.is_permanent(), eff.get_intensity(), force,
deferred});
scheduled_effects.push( scheduled_effect{eff.get_id(), eff.get_duration(), eff.get_bp(),
eff.is_permanent(), eff.get_intensity(), force,
deferred} );
}
void Creature::schedule_effect( const efftype_id &eff_id, const time_duration &dur, bodypart_id bp,
bool permanent, int intensity, bool force, bool deferred )
{
scheduled_effects.push(scheduled_effect{eff_id, dur, bp,
permanent, intensity, force,
deferred});
scheduled_effects.push( scheduled_effect{eff_id, dur, bp,
permanent, intensity, force,
deferred} );
}
void Creature::schedule_effect( const efftype_id &eff_id,
const time_duration &dur, bool permanent, int intensity, bool force,
bool deferred )
{
scheduled_effects.push(scheduled_effect{eff_id, dur, bodypart_str_id::NULL_ID(),
permanent, intensity, force, deferred});
scheduled_effects.push( scheduled_effect{eff_id, dur, bodypart_str_id::NULL_ID(),
permanent, intensity, force, deferred} );
}

bool Creature::add_env_effect( const efftype_id &eff_id, const bodypart_id &vector, int strength,
Expand Down Expand Up @@ -1424,7 +1424,7 @@ bool Creature::remove_effect( const efftype_id &eff_id )

void Creature::schedule_effect_removal( const efftype_id &eff_id, const bodypart_id &bp )
{
terminating_effects.push(terminating_effect{eff_id, bp});
terminating_effects.push( terminating_effect{eff_id, bp} );
}
void Creature::schedule_effect_removal( const efftype_id &eff_id )
{
Expand Down
18 changes: 8 additions & 10 deletions src/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ struct enum_traits<get_body_part_flags> {
static constexpr bool is_flag_enum = true;
};

using scheduled_effect = struct scheduled_effect_t
{
using scheduled_effect = struct scheduled_effect_t {
efftype_id eff_id;
time_duration dur;
bodypart_id bp;
Expand All @@ -232,8 +231,7 @@ using scheduled_effect = struct scheduled_effect_t
bool deferred = false;
};

using terminating_effect = struct terminating_effect_t
{
using terminating_effect = struct terminating_effect_t {
efftype_id eff_id;
bodypart_id bp;
};
Expand Down Expand Up @@ -567,12 +565,12 @@ class Creature : public viewer
/** Schedules a new effect to be applied. Used during effect processing to avoid invalidating
current effects map. */
void schedule_effect( const effect &eff, bool force = false,
bool deferred = false );
bool deferred = false );
void schedule_effect( const efftype_id &eff_id, const time_duration &dur,
bodypart_id bp, bool permanent = false, int intensity = 0, bool force = false,
bool deferred = false );
bodypart_id bp, bool permanent = false, int intensity = 0, bool force = false,
bool deferred = false );
void schedule_effect( const efftype_id &eff_id, const time_duration &dur,
bool permanent = false, int intensity = 0, bool force = false, bool deferred = false );
bool permanent = false, int intensity = 0, bool force = false, bool deferred = false );
/** Gives chance to save via environmental resist, returns false if resistance was successful. */
bool add_env_effect( const efftype_id &eff_id, const bodypart_id &vector, int strength,
const time_duration &dur, const bodypart_id &bp, bool permanent = false, int intensity = 1,
Expand All @@ -585,8 +583,8 @@ class Creature : public viewer
bool remove_effect( const efftype_id &eff_id, const bodypart_id &bp );
bool remove_effect( const efftype_id &eff_id );
/** Schedule effect removal */
void schedule_effect_removal(const efftype_id &eff_id, const bodypart_id &bp);
void schedule_effect_removal(const efftype_id &eff_id);
void schedule_effect_removal( const efftype_id &eff_id, const bodypart_id &bp );
void schedule_effect_removal( const efftype_id &eff_id );
/** Remove all effects. */
void clear_effects();
/** Check if creature has the matching effect. If the bodypart is not specified check if the Creature has any effect
Expand Down
3 changes: 2 additions & 1 deletion src/player_hardcoded_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,8 @@ void Character::hardcoded_effects( effect &it )
}
if( zed_number > 0 ) {
//If intensity isn't pass the cap, average it with # of zeds
schedule_effect( effect_grabbed, 2_turns, bodypart_id( "torso" ), false, ( intense + zed_number ) / 2 );
schedule_effect( effect_grabbed, 2_turns, bodypart_id( "torso" ), false,
( intense + zed_number ) / 2 );
}
} else if( id == effect_bite ) {
bool recovered = false;
Expand Down

0 comments on commit f6fe965

Please sign in to comment.