From 92ec34753fb31e109e7a23678e26185271df7734 Mon Sep 17 00:00:00 2001 From: Anton Popovichenko Date: Fri, 13 Sep 2024 19:23:05 +0000 Subject: [PATCH] =?UTF-8?q?fix(Core/Creature):=20Add=20support=20for=20CRE?= =?UTF-8?q?ATURE=5FFLAG=5FEXTRA=5FNO=5FPARRY=5FHAST=E2=80=A6=20(#19927)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/game/Entities/Unit/Unit.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 705c36e23..692e67fb5 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1847,7 +1847,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) if (damageInfo->blocked_amount && damageInfo->TargetState != VICTIMSTATE_BLOCKS) victim->HandleEmoteCommand(EMOTE_ONESHOT_PARRY_SHIELD); - if (damageInfo->TargetState == VICTIMSTATE_PARRY) + // Parry haste is enabled if it's not a creature or if the creature doesn't have the NO_PARRY_HASTEN flag. + bool isParryHasteEnabled = !victim->IsCreature() || + !victim->ToCreature()->GetCreatureTemplate()->HasFlagsExtra(CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN); + if (damageInfo->TargetState == VICTIMSTATE_PARRY && isParryHasteEnabled) { // Get attack timers float offtime = float(victim->getAttackTimer(OFF_ATTACK));