mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
Correctly fix my change (r10666 / 672c38da05).
Kudos go to QAston. --HG-- branch : trunk
This commit is contained in:
@@ -911,15 +911,17 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
||||
if (!trapSpell) // checked at load already
|
||||
return;
|
||||
|
||||
/*** FIXME: this maybe not correct ***/
|
||||
float range;
|
||||
SpellRangeEntry const * srentry = sSpellRangeStore.LookupEntry(trapSpell->rangeIndex);
|
||||
//get owner to check hostility of GameObject
|
||||
if (Unit *owner = GetOwner())
|
||||
range = (float)owner->GetSpellMaxRangeForTarget(target, srentry);
|
||||
else
|
||||
//if no owner assume that object is hostile to target
|
||||
if (GetSpellMaxRangeForHostile(srentry) == GetSpellMaxRangeForFriend(srentry))
|
||||
range = GetSpellMaxRangeForHostile(srentry);
|
||||
else
|
||||
// get owner to check hostility of GameObject
|
||||
if (Unit *owner = GetOwner())
|
||||
range = (float)owner->GetSpellMaxRangeForTarget(target, srentry);
|
||||
else
|
||||
// if no owner assume that object is hostile to target
|
||||
range = GetSpellMaxRangeForHostile(srentry);
|
||||
|
||||
// search nearest linked GO
|
||||
GameObject* trapGO = NULL;
|
||||
|
||||
Reference in New Issue
Block a user