Skip to content

Commit

Permalink
Apply suggestions from automated code review
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ThePotatomancer and github-actions[bot] authored Sep 2, 2024
1 parent 41d9795 commit c6aea82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2239,12 +2239,12 @@ std::vector<spell *> 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;

Check failure on line 2244 in src/magic.cpp

View workflow job for this annotation

GitHub Actions / build (src)

multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors]
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;
}
Expand Down Expand Up @@ -2920,8 +2920,8 @@ int known_magic::select_spell( Character &guy )

casting_ignore = static_cast<spellcasting_callback *>( 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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit c6aea82

Please sign in to comment.