feat(Core/Packet): CMSG_SET_SHEATHED

This commit is contained in:
IntelligentQuantum
2022-03-11 20:42:21 +03:30
committed by GitHub
parent a775ddcb5b
commit 1f90a18a58
8 changed files with 78 additions and 11 deletions

View File

@@ -16,6 +16,7 @@
*/
#include "CreatureAI.h"
#include "CombatPackets.h"
#include "Log.h"
#include "ObjectAccessor.h"
#include "ObjectDefines.h"
@@ -70,18 +71,15 @@ void WorldSession::HandleAttackStopOpcode(WorldPacket& /*recvData*/)
GetPlayer()->AttackStop();
}
void WorldSession::HandleSetSheathedOpcode(WorldPacket& recvData)
void WorldSession::HandleSetSheathedOpcode(WorldPackets::Combat::SetSheathed& packet)
{
uint32 sheathed;
recvData >> sheathed;
if (sheathed >= MAX_SHEATH_STATE)
if (packet.CurrentSheathState >= MAX_SHEATH_STATE)
{
LOG_ERROR("network.opcode", "Unknown sheath state {} ??", sheathed);
LOG_ERROR("network.opcode", "Unknown sheath state {} ??", packet.CurrentSheathState);
return;
}
GetPlayer()->SetSheath(SheathState(sheathed));
_player->SetSheath(SheathState(packet.CurrentSheathState));
}
void WorldSession::SendAttackStop(Unit const* enemy)