From b34ebf5a9027d948fb9563fd8a1257d577e4659d Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Wed, 17 Jul 2024 16:29:54 +0800 Subject: [PATCH] [Crash fix] Teleport bots exceed dungeon max players limit --- src/strategy/actions/UseMeetingStoneAction.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/strategy/actions/UseMeetingStoneAction.cpp b/src/strategy/actions/UseMeetingStoneAction.cpp index f0267e0c..5cf93e14 100644 --- a/src/strategy/actions/UseMeetingStoneAction.cpp +++ b/src/strategy/actions/UseMeetingStoneAction.cpp @@ -164,6 +164,15 @@ bool SummonAction::SummonUsingNpcs(Player* summoner, Player* player) bool SummonAction::Teleport(Player* summoner, Player* player) { Player* master = GetMaster(); + if (master->GetMap() && master->GetMap()->IsDungeon()) { + InstanceMap* map = master->GetMap()->ToInstanceMap(); + if (map) { + if (map->CannotEnter(player) == Map::CANNOT_ENTER_MAX_PLAYERS) { + botAI->TellError("I can not enter this dungeon"); + return false; + } + } + } if (!summoner->IsBeingTeleported() && !player->IsBeingTeleported()) { float followAngle = GetFollowAngle();