[8403] Fixed cast spell opcode parsing for some cases with additional data. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
@@ -246,8 +246,11 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Trinity::IsValidMapCoord(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o))
|
||||
if (!MaNGOS::IsValidMapCoord(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o))
|
||||
{
|
||||
recv_data.rpos(recv_data.wpos()); // prevent warnings spam
|
||||
return;
|
||||
}
|
||||
|
||||
/* handle special cases */
|
||||
if (movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT)
|
||||
@@ -255,11 +258,17 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||
// transports size limited
|
||||
// (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped)
|
||||
if( movementInfo.t_x > 50 || movementInfo.t_y > 50 || movementInfo.t_z > 50 )
|
||||
{
|
||||
recv_data.rpos(recv_data.wpos()); // prevent warnings spam
|
||||
return;
|
||||
}
|
||||
|
||||
if( !MaNGOS::IsValidMapCoord(movementInfo.x+movementInfo.t_x, movementInfo.y + movementInfo.t_y,
|
||||
movementInfo.z + movementInfo.t_z, movementInfo.o + movementInfo.t_o) )
|
||||
{
|
||||
recv_data.rpos(recv_data.wpos()); // prevent warnings spam
|
||||
return;
|
||||
}
|
||||
|
||||
// if we boarded a transport, add us to it
|
||||
if (plMover && !plMover->m_transport)
|
||||
|
||||
@@ -292,7 +292,10 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
// ignore for remote control state (for player case)
|
||||
Unit* mover = _player->m_mover;
|
||||
if(mover != _player && mover->GetTypeId()==TYPEID_PLAYER)
|
||||
{
|
||||
recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet
|
||||
return;
|
||||
}
|
||||
|
||||
sLog.outDebug("WORLD: got cast spell packet, spellId - %u, cast_count: %u, unk_flags %u, data length = %i",
|
||||
spellId, cast_count, unk_flags, (uint32)recvPacket.size());
|
||||
@@ -302,6 +305,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
if(!spellInfo)
|
||||
{
|
||||
sLog.outError("WORLD: unknown spell id %u", spellId);
|
||||
recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -311,6 +315,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
if (!((Player*)mover)->HasActiveSpell (spellId) || IsPassiveSpell(spellId) )
|
||||
{
|
||||
//cheater? kick? ban?
|
||||
recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -320,6 +325,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
if (!((Creature*)mover)->HasSpell(spellId) || IsPassiveSpell(spellId) )
|
||||
{
|
||||
//cheater? kick? ban?
|
||||
recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -337,7 +343,21 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
// client provided targets
|
||||
SpellCastTargets targets;
|
||||
if(!targets.read(&recvPacket,mover))
|
||||
{
|
||||
recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet
|
||||
return;
|
||||
}
|
||||
|
||||
// some spell cast packet including more data (for projectiles?)
|
||||
if (unk_flags & 0x02)
|
||||
{
|
||||
//recvPacket.read_skip<float>(); // unk1, coords?
|
||||
//recvPacket.read_skip<float>(); // unk1, coords?
|
||||
recvPacket.read_skip<uint8>(); // >> 1
|
||||
recvPacket.read_skip<uint32>(); // >> MSG_MOVE_STOP
|
||||
MovementInfo movementInfo;
|
||||
ReadMovementInfo(recvPacket, &movementInfo);
|
||||
}
|
||||
|
||||
// auto-selection buff level base at target level (in spellInfo)
|
||||
if(targets.getUnitTarget())
|
||||
|
||||
Reference in New Issue
Block a user