diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 440295a44..9f064b9f8 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -835,6 +835,9 @@ void GameObject::TriggeringLinkedGameObject( uint32 trapEntry, Unit* target) return; SpellEntry const* trapSpell = sSpellStore.LookupEntry(trapInfo->trap.spellId); + + // TODO: allow all traps to be activated, some are without spell + // but will have animation and/or are expected to despawn if(!trapSpell) // checked at load already return; @@ -843,14 +846,17 @@ void GameObject::TriggeringLinkedGameObject( uint32 trapEntry, Unit* target) // search nearest linked GO GameObject* trapGO = NULL; { - // using original GO distance - MaNGOS::NearestGameObjectEntryInObjectRangeCheck go_check(*target,trapEntry,range); - MaNGOS::GameObjectLastSearcher checker(trapGO,go_check); + // search closest with base of used GO, using max range of trap spell as search radius + MaNGOS::NearestGameObjectEntryInObjectRangeCheck go_check(*this, trapEntry, range); + MaNGOS::GameObjectLastSearcher checker(trapGO, go_check); Cell::VisitGridObjects(this, checker, range); } // found correct GO + + // TODO: handle the GO with Use() + // FIXME: when GO casting will be implemented trap must cast spell to target if(trapGO) target->CastSpell(target, trapSpell, true, NULL, NULL, GetGUID()); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 78a2c6dd3..38c652f15 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10858" + #define REVISION_NR "10859" #endif // __REVISION_NR_H__