mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-23 13:36:23 +00:00
[Crash fix] Teleport bots exceed dungeon max players limit
This commit is contained in:
@@ -164,6 +164,15 @@ bool SummonAction::SummonUsingNpcs(Player* summoner, Player* player)
|
|||||||
bool SummonAction::Teleport(Player* summoner, Player* player)
|
bool SummonAction::Teleport(Player* summoner, Player* player)
|
||||||
{
|
{
|
||||||
Player* master = GetMaster();
|
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())
|
if (!summoner->IsBeingTeleported() && !player->IsBeingTeleported())
|
||||||
{
|
{
|
||||||
float followAngle = GetFollowAngle();
|
float followAngle = GetFollowAngle();
|
||||||
|
|||||||
Reference in New Issue
Block a user