mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
*Update zone for players after adding to map. - by VladimirMangos
*Skip instance loading for player with flypath/on transport. --HG-- branch : trunk
This commit is contained in:
@@ -1234,7 +1234,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
return false;
|
||||
}
|
||||
|
||||
//spawn node-objects
|
||||
//spawn node-objects
|
||||
for (uint8 i = BG_AV_NODES_FIRSTAID_STATION ; i < BG_AV_NODES_MAX; ++i)
|
||||
{
|
||||
if( i <= BG_AV_NODES_FROSTWOLF_HUT )
|
||||
|
||||
@@ -66,6 +66,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
|
||||
GetPlayer()->SetSemaphoreTeleportFar(false);
|
||||
|
||||
Map * oldMap = GetPlayer()->GetMap();
|
||||
// relocate the player to the teleport destination
|
||||
Map * newMap = MapManager::Instance().CreateMap(loc.mapid, GetPlayer(), 0);
|
||||
// the CanEnter checks are done in TeleporTo but conditions may change
|
||||
@@ -86,6 +87,8 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
if(!GetPlayer()->GetMap()->Add(GetPlayer()))
|
||||
{
|
||||
sLog.outError("WORLD: failed to teleport player %s (%d) to map %d because of unknown reason!", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.mapid);
|
||||
GetPlayer()->ResetMap();
|
||||
GetPlayer()->SetMap(oldMap);
|
||||
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14656,7 +14656,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||
else if (transGUID != 0)
|
||||
{
|
||||
// There are no transports on instances
|
||||
assert (!instanceId);
|
||||
instanceId = 0;
|
||||
|
||||
m_movementInfo.t_x = fields[27].GetFloat();
|
||||
m_movementInfo.t_y = fields[28].GetFloat();
|
||||
@@ -14713,7 +14713,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||
else if (!taxi_nodes.empty()) // Taxi Flight path loaded from db
|
||||
{
|
||||
// There are no flightpaths in instances
|
||||
assert (!instanceId);
|
||||
instanceId = 0;
|
||||
|
||||
if(!m_taxi.LoadTaxiDestinationsFromString(taxi_nodes,GetTeam()))
|
||||
{
|
||||
@@ -18969,11 +18969,6 @@ void Player::SendInitialPacketsBeforeAddToMap()
|
||||
m_reputationMgr.SendInitialReputations();
|
||||
m_achievementMgr.SendAllAchievementData();
|
||||
|
||||
// update zone
|
||||
uint32 newzone, newarea;
|
||||
GetZoneAndAreaId(newzone,newarea);
|
||||
UpdateZone(newzone,newarea); // also call SendInitWorldStates();
|
||||
|
||||
SendEquipmentSetList();
|
||||
|
||||
data.Initialize(SMSG_LOGIN_SETTIMESPEED, 4 + 4 + 4);
|
||||
@@ -18985,6 +18980,11 @@ void Player::SendInitialPacketsBeforeAddToMap()
|
||||
|
||||
void Player::SendInitialPacketsAfterAddToMap()
|
||||
{
|
||||
// update zone
|
||||
uint32 newzone, newarea;
|
||||
GetZoneAndAreaId(newzone,newarea);
|
||||
UpdateZone(newzone,newarea); // also call SendInitWorldStates();
|
||||
|
||||
WorldPacket data(SMSG_TIME_SYNC_REQ, 4); // new 2.0.x, enable movement
|
||||
data << uint32(0x00000000); // on blizz it increments periodically
|
||||
GetSession()->SendPacket(&data);
|
||||
|
||||
Reference in New Issue
Block a user