diff --git a/src/server/game/Entities/Player/PlayerUpdates.cpp b/src/server/game/Entities/Player/PlayerUpdates.cpp index 6c20e8070ab317..112f9928aedc4a 100644 --- a/src/server/game/Entities/Player/PlayerUpdates.cpp +++ b/src/server/game/Entities/Player/PlayerUpdates.cpp @@ -1221,7 +1221,8 @@ void Player::UpdateArea(uint32 newArea) { SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); pvpInfo.IsInNoPvPArea = true; - CombatStopWithPets(); + if (!duel && GetCombatManager().HasPvPCombat()) + CombatStopWithPets(); } else RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index b15be116dc996b..783a7bf124508a 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -889,13 +889,17 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/) } } - // handle updates for creatures in combat with player and are more than X yards away + // handle updates for creatures in combat with player and are more than 60 yards away if (player->IsInCombat()) { + std::vector toVisit; for (auto const& pair : player->GetCombatManager().GetPvECombatRefs()) if (Creature* unit = pair.second->GetOther(player)->ToCreature()) if (unit->GetMapId() == player->GetMapId() && !unit->IsWithinDistInMap(player, GetVisibilityRange(), false)) - VisitNearbyCellsOf(unit, grid_object_update, world_object_update, grid_large_object_update, world_large_object_update); + toVisit.push_back(unit); + + for (Unit* unit : toVisit) + VisitNearbyCellsOf(unit, grid_object_update, world_object_update, grid_large_object_update, world_large_object_update); } }