Core/Protocol: Fix struct and make use of CMSG_UPDATE_PROJECTILE_POSITION.
This commit is contained in:
@@ -650,13 +650,22 @@ void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket)
|
|||||||
uint8 castCount;
|
uint8 castCount;
|
||||||
float x, y, z; // Position of missile hit
|
float x, y, z; // Position of missile hit
|
||||||
|
|
||||||
recvPacket.readPackGUID(casterGuid);
|
recvPacket >> casterGuid;
|
||||||
recvPacket >> spellId;
|
recvPacket >> spellId;
|
||||||
recvPacket >> castCount;
|
recvPacket >> castCount;
|
||||||
recvPacket >> x;
|
recvPacket >> x;
|
||||||
recvPacket >> y;
|
recvPacket >> y;
|
||||||
recvPacket >> z;
|
recvPacket >> z;
|
||||||
|
|
||||||
|
Unit* caster = ObjectAccessor::GetUnit(*_player, casterGuid);
|
||||||
|
Spell* spell = caster ? caster->FindCurrentSpellBySpellId(spellId) : NULL;
|
||||||
|
if (spell && spell->m_targets.HasDst())
|
||||||
|
{
|
||||||
|
Position pos = *spell->m_targets.GetDstPos();
|
||||||
|
pos.Relocate(x, y, z);
|
||||||
|
spell->m_targets.ModDst(pos);
|
||||||
|
}
|
||||||
|
|
||||||
WorldPacket data(SMSG_SET_PROJECTILE_POSITION, 21);
|
WorldPacket data(SMSG_SET_PROJECTILE_POSITION, 21);
|
||||||
data << uint64(casterGuid);
|
data << uint64(casterGuid);
|
||||||
data << uint8(castCount);
|
data << uint8(castCount);
|
||||||
|
|||||||
@@ -1248,8 +1248,8 @@ enum Opcodes
|
|||||||
SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x4BB,
|
SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x4BB,
|
||||||
SMSG_EQUIPMENT_SET_LIST = 0x4BC, // equipment manager list?
|
SMSG_EQUIPMENT_SET_LIST = 0x4BC, // equipment manager list?
|
||||||
CMSG_EQUIPMENT_SET_SAVE = 0x4BD,
|
CMSG_EQUIPMENT_SET_SAVE = 0x4BD,
|
||||||
CMSG_UPDATE_PROJECTILE_POSITION = 0x4BE, // uint64 caster, uint32 spellId, uint8 castId, vector3 position
|
CMSG_UPDATE_PROJECTILE_POSITION = 0x4BE,
|
||||||
SMSG_SET_PROJECTILE_POSITION = 0x4BF, // uint64 caster, uint8 castId, vector3 position
|
SMSG_SET_PROJECTILE_POSITION = 0x4BF,
|
||||||
SMSG_TALENTS_INFO = 0x4C0,
|
SMSG_TALENTS_INFO = 0x4C0,
|
||||||
CMSG_LEARN_PREVIEW_TALENTS = 0x4C1,
|
CMSG_LEARN_PREVIEW_TALENTS = 0x4C1,
|
||||||
CMSG_LEARN_PREVIEW_TALENTS_PET = 0x4C2,
|
CMSG_LEARN_PREVIEW_TALENTS_PET = 0x4C2,
|
||||||
|
|||||||
Reference in New Issue
Block a user