fix(Core/Map): Fix zone player count update on player removal (#23211)
This commit is contained in:
@@ -422,6 +422,8 @@ void Map::UpdatePlayerZoneStats(uint32 oldZone, uint32 newZone)
|
|||||||
else
|
else
|
||||||
--oldZoneCount;
|
--oldZoneCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newZone != MAP_INVALID_ZONE)
|
||||||
++_zonePlayerCountMap[newZone];
|
++_zonePlayerCountMap[newZone];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -696,8 +698,8 @@ struct ResetNotifier
|
|||||||
|
|
||||||
void Map::RemovePlayerFromMap(Player* player, bool remove)
|
void Map::RemovePlayerFromMap(Player* player, bool remove)
|
||||||
{
|
{
|
||||||
// Before leaving map, update zone/area for stats
|
UpdatePlayerZoneStats(player->GetZoneId(), MAP_INVALID_ZONE);
|
||||||
player->UpdateZone(MAP_INVALID_ZONE, 0);
|
|
||||||
player->getHostileRefMgr().deleteReferences(true); // pussywizard: multithreading crashfix
|
player->getHostileRefMgr().deleteReferences(true); // pussywizard: multithreading crashfix
|
||||||
|
|
||||||
player->RemoveFromWorld();
|
player->RemoveFromWorld();
|
||||||
|
|||||||
Reference in New Issue
Block a user