mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
fix(Core/Spells): Correct follow position for Pets and Companions. (#23154)
Co-authored-by: sogladev <sogladev@gmail.com>
This commit is contained in:
@@ -2429,8 +2429,14 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SUMMON_TYPE_JEEVES:
|
||||
case SUMMON_TYPE_MINIPET:
|
||||
// For companions, recalculate the position to ensure they spawn at the intended π/4 angle.
|
||||
destTarget->Relocate(m_originalCaster->GetNearPosition(
|
||||
m_originalCaster->GetDistance2d(destTarget->GetPositionX(), destTarget->GetPositionY()),
|
||||
MINI_PET_SUMMON_ANGLE
|
||||
));
|
||||
[[fallthrough]];
|
||||
case SUMMON_TYPE_JEEVES:
|
||||
{
|
||||
summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id, 0, personalSpawn);
|
||||
if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION))
|
||||
@@ -2446,8 +2452,9 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
|
||||
//summon->AI()->EnterEvadeMode();
|
||||
if (properties->Type != SUMMON_TYPE_JEEVES)
|
||||
{
|
||||
summon->SetFacingToObject(m_originalCaster);
|
||||
summon->GetMotionMaster()->Clear(false);
|
||||
summon->GetMotionMaster()->MoveFollow(m_originalCaster, PET_FOLLOW_DIST, summon->GetFollowAngle(), MOTION_SLOT_ACTIVE);
|
||||
summon->GetMotionMaster()->MoveFollow(m_originalCaster, PET_FOLLOW_DIST, MINI_PET_FOLLOW_ANGLE, MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user