diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 6996d460..4e90e020 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -450,22 +450,24 @@ void PlayerbotAI::HandleTeleportAck() bot->GetMotionMaster()->Clear(true); bot->StopMoving(); - if (bot->IsBeingTeleportedNear()) - { - WorldPacket p = WorldPacket(MSG_MOVE_TELEPORT_ACK, 8 + 4 + 4); - p << bot->GetGUID().WriteAsPacked(); - p << (uint32) 0; // supposed to be flags? not used currently - p << (uint32) time(nullptr); // time - not currently used - bot->GetSession()->HandleMoveTeleportAck(p); - - // add delay to simulate teleport delay + if (bot->IsBeingTeleportedNear()) { + while (bot->IsInWorld() && bot->IsBeingTeleportedNear()) { + Player* plMover = bot->m_mover->ToPlayer(); + if (!plMover) + return; + WorldPacket p = WorldPacket(MSG_MOVE_TELEPORT_ACK, 8 + 4 + 4); + p << plMover->GetPackGUID(); + p << (uint32) 0; // supposed to be flags? not used currently + p << (uint32) 0; // time - not currently used + bot->GetSession()->HandleMoveTeleportAck(p); + } SetNextCheckDelay(urand(1000, 3000)); - } - else if (bot->IsBeingTeleportedFar()) + } + if (bot->IsBeingTeleportedFar()) { - bot->GetSession()->HandleMoveWorldportAck(); - - // add delay to simulate teleport delay + while (bot->IsBeingTeleportedFar()) { + bot->GetSession()->HandleMoveWorldportAck(); + } SetNextCheckDelay(urand(2000, 5000)); } 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(); diff --git a/src/strategy/values/AoeValues.h b/src/strategy/values/AoeValues.h index 45fedf87..0eb22bb5 100644 --- a/src/strategy/values/AoeValues.h +++ b/src/strategy/values/AoeValues.h @@ -46,7 +46,7 @@ class AreaDebuffValue : public CalculatedValue { public: AreaDebuffValue(PlayerbotAI* botAI) : - CalculatedValue(botAI, "area debuff", 1 * 1000) { } + CalculatedValue(botAI, "area debuff", 1) { } Aura* Calculate() override; };