diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index 8b020f53c..a9066aea4 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -96,6 +96,7 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, SpellE m_radius = radius; m_effIndex = effIndex; m_spellId = spellId; + m_positive = IsPositiveEffect(m_spellId, m_effIndex); return true; } @@ -127,7 +128,7 @@ void DynamicObject::Update(uint32 update_diff, uint32 p_time) if(m_radius) { // TODO: make a timer and update this in larger intervals - MaNGOS::DynamicObjectUpdater notifier(*this, caster); + MaNGOS::DynamicObjectUpdater notifier(*this, caster, m_positive); Cell::VisitAllObjects(this, notifier, m_radius); } diff --git a/src/game/DynamicObject.h b/src/game/DynamicObject.h index 5d5bde6f4..292354379 100644 --- a/src/game/DynamicObject.h +++ b/src/game/DynamicObject.h @@ -65,6 +65,7 @@ class DynamicObject : public WorldObject SpellEffectIndex m_effIndex; int32 m_aliveDuration; float m_radius; // radius apply persistent effect, 0 = no persistent effect + bool m_positive; AffectedSet m_affected; private: GridReference m_gridRef; diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index fd8cf88ef..9ac71ee02 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -148,7 +148,8 @@ namespace MaNGOS { DynamicObject &i_dynobject; Unit* i_check; - DynamicObjectUpdater(DynamicObject &dynobject, Unit* caster) : i_dynobject(dynobject) + bool i_positive; + DynamicObjectUpdater(DynamicObject &dynobject, Unit* caster, bool positive) : i_dynobject(dynobject), i_positive(positive) { i_check = caster; Unit* owner = i_check->GetOwner(); diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 151a03ea5..44540ed17 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -136,14 +136,15 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target) if (target->GetTypeId() == TYPEID_PLAYER && target != i_check && (((Player*)target)->isGameMaster() || ((Player*)target)->GetVisibility() == VISIBILITY_OFF)) return; + // for player casts use less strict negative and more stricted positive targeting if (i_check->GetTypeId() == TYPEID_PLAYER ) { - if (i_check->IsFriendlyTo( target )) - return; + if (i_check->IsFriendlyTo( target ) != i_positive) + return; } else { - if (!i_check->IsHostileTo( target )) + if (i_check->IsHostileTo( target ) == i_positive) return; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b98dc9678..303a25202 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 "11219" + #define REVISION_NR "11220" #endif // __REVISION_NR_H__