*Update WorldSession::HandleMovementOpcodes with some new information on how vehicles behave, and do a little bit of cleanup.
--HG-- branch : trunk
This commit is contained in:
@@ -419,7 +419,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
||||
{
|
||||
std::set<uint32>::const_iterator it = m_unique_users.begin();
|
||||
std::set<uint32>::const_iterator end = m_unique_users.end();
|
||||
for (; it != end; it++)
|
||||
for (; it != end; ++it)
|
||||
{
|
||||
Unit* owner = Unit::GetUnit(*this, uint64(*it));
|
||||
// For now we do not support go cast
|
||||
@@ -988,7 +988,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
if (!ChairListSlots.size()) // this is called once at first chair use to make list of available slots
|
||||
if (info->chair.slots > 0) // sometimes chairs in DB have error in fields and we dont know number of slots
|
||||
for (uint32 i=0; i<info->chair.slots; i++)
|
||||
for (uint32 i = 0; i < info->chair.slots; ++i)
|
||||
ChairListSlots[i] = 0; // Last user of current slot set to 0 (none sit here yet)
|
||||
else
|
||||
ChairListSlots[0] = 0; // error in DB, make one default slot
|
||||
|
||||
@@ -225,10 +225,15 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)
|
||||
|
||||
void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||
{
|
||||
uint32 opcode = recv_data.GetOpcode();
|
||||
uint16 opcode = recv_data.GetOpcode();
|
||||
//sLog.outDebug("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode);
|
||||
|
||||
Unit *mover = _player->m_mover;
|
||||
|
||||
// vehicles become the mover, so mover->GetVehicle() should never be true
|
||||
// also, if the mover is a vehicle, it should never be on a transport
|
||||
assert(mover && !mover->GetVehicle() && (!mover->IsVehicle() || !mover->GetTransport()));
|
||||
|
||||
Player *plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL;
|
||||
|
||||
// ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck
|
||||
@@ -251,7 +256,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||
return;
|
||||
}
|
||||
|
||||
if (!MaNGOS::IsValidMapCoord(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o))
|
||||
if (!Trinity::IsValidMapCoord(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o))
|
||||
{
|
||||
recv_data.rpos(recv_data.wpos()); // prevent warnings spam
|
||||
return;
|
||||
@@ -268,7 +273,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||
return;
|
||||
}
|
||||
|
||||
if( !MaNGOS::IsValidMapCoord(movementInfo.x+movementInfo.t_x, movementInfo.y + movementInfo.t_y,
|
||||
if (!Trinity::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
|
||||
@@ -276,7 +281,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||
}
|
||||
|
||||
// if we boarded a transport, add us to it
|
||||
if (plMover && !plMover->m_transport)
|
||||
if (plMover && !plMover->GetTransport() && !mover->IsVehicle())
|
||||
{
|
||||
// elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list
|
||||
for (MapManager::TransportSet::const_iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter)
|
||||
@@ -290,7 +295,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||
}
|
||||
}
|
||||
|
||||
if(!mover->GetTransport() && !mover->GetVehicle())
|
||||
if (!mover->GetTransport() && !mover->IsVehicle())
|
||||
movementInfo.flags &= ~MOVEMENTFLAG_ONTRANSPORT;
|
||||
}
|
||||
else if (plMover && plMover->m_transport) // if we were on a transport, leave
|
||||
@@ -326,12 +331,6 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||
|
||||
mover->m_movementInfo = movementInfo;
|
||||
|
||||
if(mover->GetVehicle())
|
||||
{
|
||||
mover->SetOrientation(movementInfo.o);
|
||||
return;
|
||||
}
|
||||
|
||||
if (plMover) // nothing is charmed, or player charmed
|
||||
{
|
||||
plMover->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
|
||||
|
||||
@@ -15169,7 +15169,6 @@ void Unit::OutDebugInfo() const
|
||||
sLog.outString("On vehicle %u.", GetVehicleBase()->GetEntry());
|
||||
}
|
||||
|
||||
// MrSmite 09-05-2009 PetAI_v1.0
|
||||
void CharmInfo::SetIsCommandAttack(bool val)
|
||||
{
|
||||
m_isCommandAttack = val;
|
||||
|
||||
Reference in New Issue
Block a user