From 2c9502a63b5d3d9b1f718a5ce2900cdd59ee68a7 Mon Sep 17 00:00:00 2001 From: b3brodie Date: Thu, 9 Jan 2025 18:45:05 -0800 Subject: [PATCH] astyle --- src/handle_action.cpp | 4 ++-- src/magic.cpp | 11 ++++++----- src/magic_type.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/handle_action.cpp b/src/handle_action.cpp index 92f16d3d69d20..b772174327bea 100644 --- a/src/handle_action.cpp +++ b/src/handle_action.cpp @@ -1856,9 +1856,9 @@ static void cast_spell( bool recast_spell = false ) } } - 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() ) { diff --git a/src/magic.cpp b/src/magic.cpp index 0a9f69358484f..63eb1c3b60c85 100644 --- a/src/magic.cpp +++ b/src/magic.cpp @@ -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; @@ -1218,7 +1218,8 @@ bool spell::can_cast( const Character &guy, std::set &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 { @@ -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; @@ -1723,7 +1724,7 @@ std::optional 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 val; @@ -1735,7 +1736,7 @@ std::optional 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 val; diff --git a/src/magic_type.h b/src/magic_type.h index e581a142ced68..0647092506320 100644 --- a/src/magic_type.h +++ b/src/magic_type.h @@ -34,7 +34,7 @@ class magic_type magic_type_id id; mod_id src_mod; - + 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;