From 8061d97853a6bea33c1391adee665679a0982f1f Mon Sep 17 00:00:00 2001 From: jdevnull <37560372+jdevnull@users.noreply.github.com> Date: Thu, 2 Jan 2025 07:47:05 -1000 Subject: [PATCH] Surprised targets don't penalize attacks against them (#762) Surprised targets don't penalize attacks --- src/newfight.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/newfight.cpp b/src/newfight.cpp index 14bbac1dc..5fab856cf 100644 --- a/src/newfight.cpp +++ b/src/newfight.cpp @@ -363,7 +363,9 @@ bool hit_with_multiweapon_toggle(struct char_data *attacker, struct char_data *v } // Setup: If your attacker is closing the distance (running), take a penalty per Core p112. - if (!def->is_paralyzed_or_insensate) { + // We can't avoid setting AFF_APPROACH in set_fighting for surprised targets since it also + // indicates not-in-melee-range, so make an exception since they're probably not moving yet. + if (!def->is_paralyzed_or_insensate && !def->is_surprised) { if (AFF_FLAGGED(def->ch, AFF_APPROACH)) att->ranged->modifiers[COMBAT_MOD_DEFENDER_MOVING] += 2; else if (!def->ranged_combat_mode && def->ch->in_room == att->ch->in_room && !IS_JACKED_IN(def->ch))