Permalink
Browse files

[mr1990] implement PUSH_INHERITED_CENTER push type. related to #933

  • Loading branch information...
1 parent f1edc9a commit a55855c6be738172442824559997c34058c98714 @rsa rsa committed May 4, 2012
Showing with 31 additions and 2 deletions.
  1. +1 −1 src/game/Spell.cpp
  2. +29 −0 src/game/Spell.h
  3. +1 −1 src/shared/revision_R2.h
View
@@ -2376,7 +2376,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
// fill real target list if no spell script target defined
FillAreaTargets(bounds.first != bounds.second ? tempTargetUnitMap : targetUnitMap,
- radius, PUSH_DEST_CENTER, bounds.first != bounds.second ? SPELL_TARGETS_ALL : targetB);
+ radius, PUSH_INHERITED_CENTER, bounds.first != bounds.second ? SPELL_TARGETS_ALL : targetB);
if (!tempTargetUnitMap.empty())
{
View
@@ -80,6 +80,7 @@ enum SpellNotifyPushType
PUSH_IN_BACK,
PUSH_SELF_CENTER,
PUSH_DEST_CENTER,
+ PUSH_INHERITED_CENTER,
PUSH_TARGET_CENTER
};
@@ -779,6 +780,20 @@ namespace MaNGOS
i_centerZ = i_spell.m_targets.m_srcZ;
}
break;
+ case PUSH_INHERITED_CENTER:
+ {
+ if (i_spell.m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION || i_spell.m_targets.m_targetMask & TARGET_FLAG_UNIT)
+ {
+ i_centerX = i_spell.m_targets.m_destX;
+ i_centerY = i_spell.m_targets.m_destY;
+ }
+ else if (i_spell.m_targets.m_targetMask & TARGET_FLAG_SOURCE_LOCATION)
+ {
+ i_centerX = i_spell.m_targets.m_srcX;
+ i_centerY = i_spell.m_targets.m_srcY;
+ }
+ break;
+ }
case PUSH_TARGET_CENTER:
if (Unit* target = i_spell.m_targets.getUnitTarget())
{
@@ -881,6 +896,20 @@ namespace MaNGOS
if (itr->getSource()->IsWithinDist3d(i_centerX, i_centerY, i_centerZ, i_radius))
i_data->push_back(itr->getSource());
break;
+ case PUSH_INHERITED_CENTER:
+ {
+ if (i_spell.m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION || i_spell.m_targets.m_targetMask & TARGET_FLAG_UNIT)
+ {
+ if (itr->getSource()->IsWithinDist3d(i_spell.m_targets.m_destX, i_spell.m_targets.m_destY, i_spell.m_targets.m_destZ,i_radius))
+ i_data->push_back(itr->getSource());
+ }
+ else if (i_spell.m_targets.m_targetMask & TARGET_FLAG_SOURCE_LOCATION)
+ {
+ if (itr->getSource()->IsWithinDist3d(i_spell.m_targets.m_srcX, i_spell.m_targets.m_srcY, i_spell.m_targets.m_srcZ, i_radius))
+ i_data->push_back(itr->getSource());
+ }
+ break;
+ }
case PUSH_TARGET_CENTER:
if (i_spell.m_targets.getUnitTarget() && i_spell.m_targets.getUnitTarget()->IsWithinDist((Unit*)(itr->getSource()), i_radius))
i_data->push_back(itr->getSource());
@@ -1,4 +1,4 @@
#ifndef __REVISION_R2_H__
#define __REVISION_R2_H__
- #define REVISION_R2 "1989"
+ #define REVISION_R2 "1990"
#endif // __REVISION_R2_H__

0 comments on commit a55855c

Please sign in to comment.