Skip to content

Commit

Permalink
Prevents dodge gain exploits (#1985)
Browse files Browse the repository at this point in the history
  • Loading branch information
joveeater authored Oct 10, 2022
1 parent 7415022 commit 7709b9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,6 @@ void monster::melee_attack( Creature &target )

void monster::melee_attack( Creature &target, float accuracy )
{
int hitspread = target.deal_melee_attack( this, melee::melee_hit_range( accuracy ) );
mod_moves( -type->attack_cost );
if( type->melee_dice == 0 ) {
// We don't attack, so just return
Expand All @@ -1410,6 +1409,8 @@ void monster::melee_attack( Creature &target, float accuracy )
return;
}

int hitspread = target.deal_melee_attack( this, melee::melee_hit_range( accuracy ) );

if( target.is_player() ||
( target.is_npc() && g->u.attitude_to( target ) == A_FRIENDLY ) ) {
// Make us a valid target for a few turns
Expand Down

0 comments on commit 7709b9e

Please sign in to comment.