aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-02-09 21:08:35 +0100
committerShauren <shauren.trinity@gmail.com>2025-02-09 21:08:35 +0100
commit8565ba987668be1ebd435d4c4edd3874ee2261ec (patch)
tree50c6cd4ae8b21af89ee49f4ad1437db3ba4f87a1 /src/server/game/Entities/Unit
parentde9340ccec2d53d4b090bc6ebfadd67cc77d7f5a (diff)
Core/PacketIO: Converted BattlegroundPackets to classes
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp16
-rw-r--r--src/server/game/Entities/Unit/Unit.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 715b79f477d..bac4222cf4d 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -20,6 +20,7 @@
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "Battleground.h"
+#include "BattlegroundPackets.h"
#include "BattlegroundScore.h"
#include "CellImpl.h"
#include "CharacterCache.h"
@@ -13584,6 +13585,21 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player const* t
data->append(fieldBuffer);
}
+void Unit::DestroyForPlayer(Player* target, bool onDeath) const
+{
+ if (Battleground* bg = target->GetBattleground())
+ {
+ if (bg->isArena())
+ {
+ WorldPackets::Battleground::DestroyArenaUnit destroyArenaUnit;
+ destroyArenaUnit.Guid = GetGUID();
+ target->GetSession()->SendPacket(destroyArenaUnit.Write());
+ }
+ }
+
+ WorldObject::DestroyForPlayer(target, onDeath);
+}
+
int32 Unit::GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const* aurEff, AuraType auraType, bool checkMiscValue /*= false*/, int32 miscValue /*= 0*/) const
{
int32 val = 0;
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index e5495134252..5991b268b87 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1833,6 +1833,7 @@ class TC_GAME_API Unit : public WorldObject
explicit Unit (bool isWorldObject);
void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player const* target) const override;
+ void DestroyForPlayer(Player* target, bool onDeath) const override;
void _UpdateSpells(uint32 time);
void _DeleteRemovedAuras();