From c6aea82970117b4db4de4ed681849e791b5b0b01 Mon Sep 17 00:00:00 2001 From: ThePotatomancer <52547005+ThePotatomancer@users.noreply.github.com> Date: Mon, 2 Sep 2024 09:11:31 +0300 Subject: [PATCH] Apply suggestions from automated code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/magic.cpp | 10 +++++----- src/magic.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/magic.cpp b/src/magic.cpp index 30f91352ba6d0..592bc3757cce0 100644 --- a/src/magic.cpp +++ b/src/magic.cpp @@ -2239,12 +2239,12 @@ std::vector known_magic::get_spells() return spells; } -int known_magic::get_spell_index( const spell_id& sp ) +int known_magic::get_spell_index( const spell_id &sp ) { int current_index = -1, result_index = -1; - for (auto& spell_pair : spellbook) { + for( auto &spell_pair : spellbook ) { current_index++; - if (spell_pair.first == sp) { + if( spell_pair.first == sp ) { result_index = current_index; break; } @@ -2920,8 +2920,8 @@ int known_magic::select_spell( Character &guy ) casting_ignore = static_cast( spell_menu.callback )->casting_ignore; - spell* selected_spell = known_spells_sorted[spell_menu.ret]; - int original_spell_index = get_spell_index(selected_spell->id()); + spell *selected_spell = known_spells_sorted[spell_menu.ret]; + int original_spell_index = get_spell_index( selected_spell->id() ); return original_spell_index; } diff --git a/src/magic.h b/src/magic.h index b50374428fb16..23136c89007d1 100644 --- a/src/magic.h +++ b/src/magic.h @@ -689,7 +689,7 @@ class known_magic // gets the spell associated with the spell_id to be edited spell &get_spell( const spell_id &sp ); // gets the index of a spell in the get_spells vector - int get_spell_index(const spell_id& sp); + int get_spell_index( const spell_id &sp ); // opens up a ui that the Character can choose a spell from // returns the index of the spell in the vector of spells int select_spell( Character &guy );