From 7709b9ede66f6171a9447a957d7d77677cdfa779 Mon Sep 17 00:00:00 2001 From: joveeater Date: Mon, 10 Oct 2022 23:27:31 +0100 Subject: [PATCH] Prevents dodge gain exploits (#1985) --- src/monster.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/monster.cpp b/src/monster.cpp index 8b7f5235d7f7..4e7b9fec9673 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -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 @@ -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