From bd9ba1b9e49d5f41d83a3376c30207700b5217d7 Mon Sep 17 00:00:00 2001 From: Exxenoz Date: Wed, 3 Apr 2024 20:19:57 +0200 Subject: [PATCH] Core/PacketIO: Fix SMSG_TRANSFER_ABORTED Picked from: https://github.com/vmangos/core Co-authored-by: brotalnia https://github.com/vmangos/core/commit/b9b006db08fcdc055057ff68a3f9fe295ead3ba5 --- src/game/Entities/Player.cpp | 6 +++--- src/game/Server/WorldSession.cpp | 8 +++----- src/game/Server/WorldSession.h | 4 +++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/game/Entities/Player.cpp b/src/game/Entities/Player.cpp index de78618f68..f769eab7b7 100644 --- a/src/game/Entities/Player.cpp +++ b/src/game/Entities/Player.cpp @@ -18080,10 +18080,10 @@ void Player::SendTransferAbortedByLockStatus(MapEntry const* mapEntry, AreaTrigg GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(LANG_LEVEL_MINREQUIRED), miscRequirement); break; case AREA_LOCKSTATUS_ZONE_IN_COMBAT: - GetSession()->SendTransferAborted(mapEntry->MapID, TRANSFER_ABORT_ZONE_IN_COMBAT); + GetSession()->SendTransferAborted(TRANSFER_ABORT_ZONE_IN_COMBAT); break; case AREA_LOCKSTATUS_INSTANCE_IS_FULL: - GetSession()->SendTransferAborted(mapEntry->MapID, TRANSFER_ABORT_MAX_PLAYERS); + GetSession()->SendTransferAborted(TRANSFER_ABORT_MAX_PLAYERS); break; case AREA_LOCKSTATUS_QUEST_NOT_COMPLETED: if (mapEntry->IsContinent()) // do not report anything for quest areatrigge @@ -18098,7 +18098,7 @@ void Player::SendTransferAbortedByLockStatus(MapEntry const* mapEntry, AreaTrigg GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, sObjectMgr.GetItemPrototype(miscRequirement)->Name1); break; case AREA_LOCKSTATUS_TOO_MANY_INSTANCE: - GetSession()->SendTransferAborted(mapEntry->MapID, TRANSFER_ABORT_TOO_MANY_INSTANCES); + GetSession()->SendTransferAborted(TRANSFER_ABORT_TOO_MANY_INSTANCES); break; case AREA_LOCKSTATUS_NOT_ALLOWED: case AREA_LOCKSTATUS_RAID_LOCKED: diff --git a/src/game/Server/WorldSession.cpp b/src/game/Server/WorldSession.cpp index f425879250..acd8971e29 100644 --- a/src/game/Server/WorldSession.cpp +++ b/src/game/Server/WorldSession.cpp @@ -1182,12 +1182,10 @@ void WorldSession::SaveTutorialsData() } // Send chat information about aborted transfer (mostly used by Player::SendTransferAbortedByLockstatus()) -void WorldSession::SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg) const +void WorldSession::SendTransferAborted(TransferAbortReason reason) const { - WorldPacket data(SMSG_TRANSFER_ABORTED, 4 + 2); - data << uint32(mapid); - data << uint8(reason); // transfer abort reason - data << uint8(0); // arg. not used + WorldPacket data(SMSG_TRANSFER_ABORTED, 1); + data << uint8(reason); SendPacket(data); } diff --git a/src/game/Server/WorldSession.h b/src/game/Server/WorldSession.h index 332ebe7170..99bd5ae9ea 100644 --- a/src/game/Server/WorldSession.h +++ b/src/game/Server/WorldSession.h @@ -38,6 +38,8 @@ #include #include +enum TransferAbortReason; + struct ItemPrototype; struct AuctionEntry; struct AuctionHouseEntry; @@ -221,7 +223,7 @@ class WorldSession void SendPetNameInvalid(uint32 error, const std::string& name) const; void SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res) const; void SendAreaTriggerMessage(const char* Text, ...) const ATTR_PRINTF(2, 3); - void SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg = 0) const; + void SendTransferAborted(TransferAbortReason reason) const; void SendQueryTimeResponse() const; bool IsInitialZoneUpdated() { return m_initialZoneUpdated; }