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
+10 -1
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);