Skip to content

Commit

Permalink
Prevent summon abuse for non-eligible players.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnchyDev committed Nov 3, 2023
1 parent a25c866 commit 15c80c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/scripts/ToSPlayerScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "TrialOfStrength.h"
#include "ToSMapMgr.h"

#include "Chat.h"

bool ToSPlayerScript::CanRepopAtGraveyard(Player* player)
{
if (!player)
Expand Down Expand Up @@ -37,6 +39,12 @@ bool ToSPlayerScript::OnBeforeTeleport(Player* player, uint32 mapId, float /*x*/
return true;
}

if (!sToSMapMgr->CanPlayerEnter(player) && mapId == TOS_MAP_ID)
{
ChatHandler(player->GetSession()).SendSysMessage("|cffFF0000You do not meet the requirements to enter the Trial of Strength.|r");
return false;
}

auto oldMapId = player->GetMapId();
if (oldMapId != TOS_MAP_ID)
{
Expand Down

0 comments on commit 15c80c0

Please sign in to comment.