Skip to content

Commit

Permalink
astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
b3brodie committed Jan 10, 2025
1 parent 8bb911c commit 2c9502a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1856,9 +1856,9 @@ static void cast_spell( bool recast_spell = false )
}

Check failure on line 1856 in src/handle_action.cpp

View workflow job for this annotation

GitHub Actions / build (directly-changed)

loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy,-warnings-as-errors]
}

for( std::string failure_message: failure_messages ) {
for( std::string failure_message : failure_messages ) {
add_msg( game_message_params{ m_bad, gmf_bypass_cooldown },
failure_message );
failure_message );
}

if( recast_spell && player_character.magic->last_spell.is_null() ) {
Expand Down
11 changes: 6 additions & 5 deletions src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ bool spell::can_cast( const Character &guy ) const
};

if( type->magic_type.has_value() ) {
for( std::string cannot_cast_flag_string: type->magic_type.value()->cannot_cast_flags ) {
for( std::string cannot_cast_flag_string : type->magic_type.value()->cannot_cast_flags ) {
json_character_flag cannot_cast_flag( cannot_cast_flag_string );
if( guy.has_flag( cannot_cast_flag ) ) {
return false;
Expand All @@ -1218,7 +1218,8 @@ bool spell::can_cast( const Character &guy, std::set<std::string> &failure_messa
{
if( can_cast( guy ) ) {
return true;
} else if ( type->magic_type.has_value() && type->magic_type.value()->cannot_cast_message.has_value() ) {
} else if( type->magic_type.has_value() &&
type->magic_type.value()->cannot_cast_message.has_value() ) {
failure_messages.insert( type->magic_type.value()->cannot_cast_message.value() );
return false;
} else {
Expand Down Expand Up @@ -1712,7 +1713,7 @@ magic_energy_type spell_type::get_energy_source() const
{
if( energy_source.has_value() ) {
return energy_source.value();
} else if ( magic_type.has_value() && magic_type.value()->energy_source.has_value() ) {
} else if( magic_type.has_value() && magic_type.value()->energy_source.has_value() ) {
return magic_type.value()->energy_source.value();
} else {
return magic_energy_type::none;
Expand All @@ -1723,7 +1724,7 @@ std::optional<jmath_func_id> spell_type::overall_get_level_formula_id() const
{
if( get_level_formula_id.has_value() ) {
return get_level_formula_id;
} else if ( magic_type.has_value() && magic_type.value()->get_level_formula_id.has_value() ) {
} else if( magic_type.has_value() && magic_type.value()->get_level_formula_id.has_value() ) {
return magic_type.value()->get_level_formula_id;
} else {
std::optional<jmath_func_id> val;
Expand All @@ -1735,7 +1736,7 @@ std::optional<jmath_func_id> spell_type::overall_exp_for_level_formula_id() cons
{
if( exp_for_level_formula_id.has_value() ) {
return exp_for_level_formula_id;
} else if ( magic_type.has_value() && magic_type.value()->exp_for_level_formula_id.has_value() ) {
} else if( magic_type.has_value() && magic_type.value()->exp_for_level_formula_id.has_value() ) {
return magic_type.value()->exp_for_level_formula_id;
} else {
std::optional<jmath_func_id> val;
Expand Down
2 changes: 1 addition & 1 deletion src/magic_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class magic_type
magic_type_id id;

mod_id src_mod;

Check failure on line 36 in src/magic_type.h

View workflow job for this annotation

GitHub Actions / build (directly-changed)

Function 'serialize' appears to be a serialization function for class 'magic_type' but does not mention field 'src_mod'. [cata-serialize,-warnings-as-errors]

static void load_magic_type( const JsonObject &jo, const std::string &src );
void load( const JsonObject &jo, std::string_view src );
void serialize( JsonOut &json ) const;
Expand Down

0 comments on commit 2c9502a

Please sign in to comment.