Skip to content

Commit

Permalink
Merge pull request CleverRaven#68854 from prharvey/magic_safety
Browse files Browse the repository at this point in the history
Add a confirmation if you are in the aoe of your own spell.
  • Loading branch information
Maleclypse authored Oct 25, 2023
2 parents d7f67bf + 4b86097 commit bcd3719
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ranged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3080,6 +3080,12 @@ void target_ui::set_last_target()

bool target_ui::confirm_non_enemy_target()
{
// Check if you are casting a spell at yourself.
if( mode == TargetMode::Spell && ( src == dst || spell_aoe.count( src ) == 1 ) ) {
if( !query_yn( _( "Really attack yourself?" ) ) ) {
return false;
}
}
npc *const who = dynamic_cast<npc *>( dst_critter );
if( who && !who->guaranteed_hostile() ) {
return query_yn( _( "Really attack %s?" ), who->get_name().c_str() );
Expand Down

0 comments on commit bcd3719

Please sign in to comment.