Core/Map:
- Fixed crash when a player was disconnected during a transfer to another map. - Only call OnPlayerLeaveMap if player is removed from map. (Ty QAston)
This commit is contained in:
@@ -496,7 +496,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
|
|||||||
ResetMap();
|
ResetMap();
|
||||||
Map* newMap = sMapMgr->CreateBaseMap(newMapid);
|
Map* newMap = sMapMgr->CreateBaseMap(newMapid);
|
||||||
SetMap(newMap);
|
SetMap(newMap);
|
||||||
ASSERT (GetMap());
|
ASSERT(GetMap());
|
||||||
AddToWorld();
|
AddToWorld();
|
||||||
|
|
||||||
if (oldMap != newMap)
|
if (oldMap != newMap)
|
||||||
|
|||||||
@@ -433,8 +433,7 @@ void Vehicle::RemovePassenger(Unit* unit)
|
|||||||
|
|
||||||
void Vehicle::RelocatePassengers(float x, float y, float z, float ang)
|
void Vehicle::RelocatePassengers(float x, float y, float z, float ang)
|
||||||
{
|
{
|
||||||
Map* map = _me->GetMap();
|
ASSERT(_me->IsInWorld());
|
||||||
ASSERT(map != NULL);
|
|
||||||
|
|
||||||
// not sure that absolute position calculation is correct, it must depend on vehicle orientation and pitch angle
|
// not sure that absolute position calculation is correct, it must depend on vehicle orientation and pitch angle
|
||||||
for (SeatMap::const_iterator itr = Seats.begin(); itr != Seats.end(); ++itr)
|
for (SeatMap::const_iterator itr = Seats.begin(); itr != Seats.end(); ++itr)
|
||||||
|
|||||||
@@ -668,7 +668,8 @@ void Map::RemovePlayerFromMap(Player* player, bool remove)
|
|||||||
if (remove)
|
if (remove)
|
||||||
DeleteFromWorld(player);
|
DeleteFromWorld(player);
|
||||||
|
|
||||||
sScriptMgr->OnPlayerLeaveMap(this, player);
|
if (remove)
|
||||||
|
sScriptMgr->OnPlayerLeaveMap(this, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|||||||
@@ -519,8 +519,8 @@ void WorldSession::LogoutPlayer(bool Save)
|
|||||||
// calls to GetMap in this case may cause crashes
|
// calls to GetMap in this case may cause crashes
|
||||||
_player->CleanupsBeforeDelete();
|
_player->CleanupsBeforeDelete();
|
||||||
sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow());
|
sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow());
|
||||||
Map* _map = _player->GetMap();
|
if (Map* _map = _player->FindMap())
|
||||||
_map->RemovePlayerFromMap(_player, true);
|
_map->RemovePlayerFromMap(_player, true);
|
||||||
SetPlayer(NULL); // deleted in Remove call
|
SetPlayer(NULL); // deleted in Remove call
|
||||||
|
|
||||||
///- Send the 'logout complete' packet to the client
|
///- Send the 'logout complete' packet to the client
|
||||||
|
|||||||
Reference in New Issue
Block a user