Summon Logic Tweaks (#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>
This commit is contained in:
dillyns
2026-01-29 15:25:50 -05:00
committed by GitHub
parent f5711dc6f7
commit a92886032c

View File

@@ -150,7 +150,7 @@ bool SummonAction::SummonUsingNpcs(Player* summoner, Player* player, bool preser
bool SummonAction::Teleport(Player* summoner, Player* player, bool preserveAuras)
{
// Player* master = GetMaster();
if (!summoner)
if (!summoner || summoner == player)
return false;
if (player->GetVehicle())
@@ -212,9 +212,11 @@ bool SummonAction::Teleport(Player* summoner, Player* player, bool preserveAuras
if (!preserveAuras)
player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TELEPORTED |
AURA_INTERRUPT_FLAG_CHANGE_MAP);
player->TeleportTo(mapId, x, y, z, 0);
if (player->GetPet())
player->GetPet()->NearTeleportTo(x, y, z, player->GetOrientation());
if (player->GetGuardianPet())
player->GetGuardianPet()->NearTeleportTo(x, y, z, player->GetOrientation());
if (botAI->HasStrategy("stay", botAI->GetState()))
{
PositionMap& posMap = AI_VALUE(PositionMap&, "position");