From a1973ced28bb1040d3303107067fe29d82781d0e Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Thu, 6 Aug 2009 01:47:09 +0400 Subject: [PATCH] [8321] For additional atatck target ignore source spell target instaed auto-attack target. This is fix targets selection in special cases for 13877, 26654 and ranks. --- src/game/Unit.cpp | 12 ++++++------ src/game/Unit.h | 2 +- src/shared/revision_nr.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 401e5dc49..cd15d63e6 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4471,7 +4471,7 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu case 13877: case 33735: { - target = SelectNearbyTarget(); + target = SelectNearbyTarget(pVictim); if(!target) return false; basepoints0 = damage; @@ -4552,7 +4552,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu if(procSpell && procSpell->Id == 26654) return false; - target = SelectNearbyTarget(); + target = SelectNearbyTarget(pVictim); if(!target) return false; @@ -5083,7 +5083,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu if(procSpell && procSpell->Id == 26654) return false; - target = SelectNearbyTarget(); + target = SelectNearbyTarget(pVictim); if(!target) return false; @@ -11386,7 +11386,7 @@ void Unit::UpdateReactives( uint32 p_time ) } } -Unit* Unit::SelectNearbyTarget() const +Unit* Unit::SelectNearbyTarget(Unit* except /*= NULL*/) const { CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY())); Cell cell(p); @@ -11408,8 +11408,8 @@ Unit* Unit::SelectNearbyTarget() const } // remove current target - if(getVictim()) - targets.remove(getVictim()); + if(except) + targets.remove(except); // remove not LoS targets for(std::list::iterator tIter = targets.begin(); tIter != targets.end();) diff --git a/src/game/Unit.h b/src/game/Unit.h index d59551093..89fdf816e 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -919,7 +919,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject Unit* getVictim() const { return m_attacking; } void CombatStop(bool includingCast = false); void CombatStopWithPets(bool includingCast = false); - Unit* SelectNearbyTarget() const; + Unit* SelectNearbyTarget(Unit* except = NULL) const; bool hasNegativeAuraWithInterruptFlag(uint32 flag); void SendMeleeAttackStop(Unit* victim); void SendMeleeAttackStart(Unit* pVictim); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 0c9419a4b..fe7e3166a 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 "8320" + #define REVISION_NR "8321" #endif // __REVISION_NR_H__