fix(Core/Map): Fix zone player count update on player removal (#23211)
This commit is contained in:
parent
8560c4825a
commit
9ff1d3f06a
1 changed files with 5 additions and 3 deletions
|
|
@ -422,7 +422,9 @@ void Map::UpdatePlayerZoneStats(uint32 oldZone, uint32 newZone)
|
|||
else
|
||||
--oldZoneCount;
|
||||
}
|
||||
++_zonePlayerCountMap[newZone];
|
||||
|
||||
if (newZone != MAP_INVALID_ZONE)
|
||||
++_zonePlayerCountMap[newZone];
|
||||
}
|
||||
|
||||
void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
|
||||
|
|
@ -696,8 +698,8 @@ struct ResetNotifier
|
|||
|
||||
void Map::RemovePlayerFromMap(Player* player, bool remove)
|
||||
{
|
||||
// Before leaving map, update zone/area for stats
|
||||
player->UpdateZone(MAP_INVALID_ZONE, 0);
|
||||
UpdatePlayerZoneStats(player->GetZoneId(), MAP_INVALID_ZONE);
|
||||
|
||||
player->getHostileRefMgr().deleteReferences(true); // pussywizard: multithreading crashfix
|
||||
|
||||
player->RemoveFromWorld();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue