Skip to content

Commit

Permalink
Merge pull request #73800 from RenechCDDA/dont_get_nonexistent_spellb…
Browse files Browse the repository at this point in the history
…ook_spell

Don't try to get non-existent spellbook spells
  • Loading branch information
Maleclypse authored May 20, 2024
2 parents f1c803e + 85c25ae commit 02d325a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2118,6 +2118,8 @@ spell &known_magic::get_spell( const spell_id &sp )
{
if( !knows_spell( sp ) ) {
debugmsg( "ERROR: Tried to get unknown spell" );
static spell null_spell_reference( spell_id::NULL_ID() );
return null_spell_reference; // Don't make up new spells in our spellbook
}
spell &temp_spell = spellbook[ sp ];
return temp_spell;
Expand Down
2 changes: 1 addition & 1 deletion src/player_activity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ std::optional<std::string> player_activity::get_progress_message( const avatar &
}

if( type == ACT_SPELLCASTING ) {
const std::string spell_name = u.magic->get_spell( spell_id( name ) ).name();
const std::string spell_name = spell_id( name )->name.translated();
extra_info = string_format( "%s …", spell_name );
}
}
Expand Down

0 comments on commit 02d325a

Please sign in to comment.