mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
Fix (core/SpellEffects): Don't randomize summoned guardian position if target is in the DB (#17506)
* Doesn't randomize placement of guardian summons if the target position was specified in the DB * Add `HasRadius()` check * Add check for zero-radius effects, update IF condition style * Accept IF condition statement suggestion Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> --------- Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -6057,8 +6057,11 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
|
||||
Position pos;
|
||||
|
||||
// xinef: do not use precalculated position for effect summon pet in this function
|
||||
// it means it was cast by NPC and should have its position overridden
|
||||
if (totalNumGuardians == 1 && GetSpellInfo()->Effects[i].Effect != SPELL_EFFECT_SUMMON_PET)
|
||||
// it means it was cast by NPC and should have its position overridden unless the
|
||||
// target position is specified in the DB AND the effect has no or zero radius
|
||||
if ((totalNumGuardians == 1 && GetSpellInfo()->Effects[i].Effect != SPELL_EFFECT_SUMMON_PET) ||
|
||||
(GetSpellInfo()->Effects[i].TargetA.GetTarget() == TARGET_DEST_DB &&
|
||||
(!GetSpellInfo()->Effects[i].HasRadius() || GetSpellInfo()->Effects[i].RadiusEntry->RadiusMax == 0)))
|
||||
{
|
||||
pos = *destTarget;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user