aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Combat/CombatManager.cpp
diff options
context:
space:
mode:
authorAlan Deutscher <adeutscher@gmail.com>2022-07-10 18:55:15 -0700
committerShauren <shauren.trinity@gmail.com>2022-09-04 22:49:08 +0200
commitb59706c8b6856bdfe084a38330773725d3404f05 (patch)
tree69b7e4ffc19c0929931a940e80ae47a0c61aae40 /src/server/game/Combat/CombatManager.cpp
parent052dfe27fc324f13f8d4cc2af802f57963d8fe7c (diff)
Core/Spells: Delay combat flagging for spell targets until spell missile lands
Diffstat (limited to 'src/server/game/Combat/CombatManager.cpp')
-rw-r--r--src/server/game/Combat/CombatManager.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/server/game/Combat/CombatManager.cpp b/src/server/game/Combat/CombatManager.cpp
index b5b8b24e068..2dabbc0ccb5 100644
--- a/src/server/game/Combat/CombatManager.cpp
+++ b/src/server/game/Combat/CombatManager.cpp
@@ -172,7 +172,7 @@ Unit* CombatManager::GetAnyTarget() const
return nullptr;
}
-bool CombatManager::SetInCombatWith(Unit* who)
+bool CombatManager::SetInCombatWith(Unit* who, bool suppressPvpSecond)
{
// Are we already in combat? If yes, refresh pvp combat
auto it = _pvpRefs.find(who->GetGUID());
@@ -191,7 +191,12 @@ bool CombatManager::SetInCombatWith(Unit* who)
// ...then create new reference
CombatReference* ref;
if (_owner->IsControlledByPlayer() && who->IsControlledByPlayer())
- ref = new PvPCombatReference(_owner, who);
+ {
+ PvPCombatReference* refPvp = new PvPCombatReference(_owner, who);
+ if (suppressPvpSecond)
+ refPvp->SuppressFor(who);
+ ref = refPvp;
+ }
else
ref = new CombatReference(_owner, who);