From ef377b9d9f2be3a17c4d1ed5a49b24c4daea4ff6 Mon Sep 17 00:00:00 2001 From: Poszer <41213210+poszer@users.noreply.github.com> Date: Tue, 6 Aug 2019 16:06:44 +0200 Subject: [PATCH] fix(Core/Instance): Fix instance resetting exploit (#2172) * fix(Core/Instance): Fix instance resetting exploit - Fix issue with instance reset exploit Co-Authored-By: Lee * Added another check Added a check to see if any players are in the current instance before teleporting the player to the entrance. --- src/server/game/Server/WorldSession.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index e0abd24ed..0b0098b9b 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -566,6 +566,12 @@ void WorldSession::LogoutPlayer(bool save) { _player->GetGroup()->SendUpdate(); _player->GetGroup()->ResetMaxEnchantingLevel(); + + Map::PlayerList const &playerList = _player->GetMap()->GetPlayers(); + + if (_player->GetMap()->IsDungeon() || _player->GetMap()->IsRaidOrHeroicDungeon()) + if (playerList.isEmpty()) + _player->TeleportToEntryPoint(); } //! Broadcast a logout message to the player's friends