Skip to content

Commit a928860

Browse files
dillynshermensbas
andauthored
Summon Logic Tweaks (mod-playerbots#2049)
Issues: - When you have selfbot enabled and use summon command, you will summon yourself. This causes odd movement if you summon while moving, and can sometimes lead to falling through the floor. - When using the summon command on bots with pets/guardians from a medium distance (like jumping down a ledge then commanding summon), the pets will pathfind run to catch up. This causes them to aggro everything on the way. Solution: Fix summon logic to prevent selfbot summon and ensure pets are teleported with bots. --------- Co-authored-by: bashermens <31279994+hermensbas@users.noreply.github.com>
1 parent f5711dc commit a928860

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/Ai/Base/Actions/UseMeetingStoneAction.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ bool SummonAction::SummonUsingNpcs(Player* summoner, Player* player, bool preser
150150
bool SummonAction::Teleport(Player* summoner, Player* player, bool preserveAuras)
151151
{
152152
// Player* master = GetMaster();
153-
if (!summoner)
153+
if (!summoner || summoner == player)
154154
return false;
155155

156156
if (player->GetVehicle())
@@ -212,9 +212,11 @@ bool SummonAction::Teleport(Player* summoner, Player* player, bool preserveAuras
212212
if (!preserveAuras)
213213
player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TELEPORTED |
214214
AURA_INTERRUPT_FLAG_CHANGE_MAP);
215-
216215
player->TeleportTo(mapId, x, y, z, 0);
217-
216+
if (player->GetPet())
217+
player->GetPet()->NearTeleportTo(x, y, z, player->GetOrientation());
218+
if (player->GetGuardianPet())
219+
player->GetGuardianPet()->NearTeleportTo(x, y, z, player->GetOrientation());
218220
if (botAI->HasStrategy("stay", botAI->GetState()))
219221
{
220222
PositionMap& posMap = AI_VALUE(PositionMap&, "position");

0 commit comments

Comments
 (0)