Core/Protocol: Fix struct and make use of CMSG_UPDATE_PROJECTILE_POSITION.

This commit is contained in:
kaelima
2012-05-25 16:44:34 +02:00
parent 929e7c0f0c
commit c40d86f05f
2 changed files with 12 additions and 3 deletions

View File

@@ -650,13 +650,22 @@ void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket)
uint8 castCount;
float x, y, z; // Position of missile hit
recvPacket.readPackGUID(casterGuid);
recvPacket >> casterGuid;
recvPacket >> spellId;
recvPacket >> castCount;
recvPacket >> x;
recvPacket >> y;
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);
data << uint64(casterGuid);
data << uint8(castCount);

View File

@@ -1248,8 +1248,8 @@ enum Opcodes
SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x4BB,
SMSG_EQUIPMENT_SET_LIST = 0x4BC, // equipment manager list?
CMSG_EQUIPMENT_SET_SAVE = 0x4BD,
CMSG_UPDATE_PROJECTILE_POSITION = 0x4BE, // uint64 caster, uint32 spellId, uint8 castId, vector3 position
SMSG_SET_PROJECTILE_POSITION = 0x4BF, // uint64 caster, uint8 castId, vector3 position
CMSG_UPDATE_PROJECTILE_POSITION = 0x4BE,
SMSG_SET_PROJECTILE_POSITION = 0x4BF,
SMSG_TALENTS_INFO = 0x4C0,
CMSG_LEARN_PREVIEW_TALENTS = 0x4C1,
CMSG_LEARN_PREVIEW_TALENTS_PET = 0x4C2,