mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8178] Fixed absent break in spell targeting code.
This commit is contained in:
parent
2b09bb19eb
commit
12ee5cdc08
2 changed files with 34 additions and 38 deletions
|
|
@ -1431,10 +1431,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
case TARGET_AREAEFFECT_CUSTOM:
|
||||
case TARGET_AREAEFFECT_CUSTOM_2:
|
||||
case TARGET_SUMMON:
|
||||
{
|
||||
TagUnitMap.push_back(m_caster);
|
||||
break;
|
||||
}
|
||||
case TARGET_RANDOM_ENEMY_CHAIN_IN_AREA:
|
||||
{
|
||||
m_targets.m_targetMask = 0;
|
||||
|
|
@ -1506,7 +1504,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
|
||||
--t;
|
||||
}
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_RANDOM_FRIEND_CHAIN_IN_AREA:
|
||||
{
|
||||
m_targets.m_targetMask = 0;
|
||||
|
|
@ -1573,7 +1572,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
next = tempUnitMap.begin();
|
||||
--t;
|
||||
}
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_PET:
|
||||
{
|
||||
Pet* tmpUnit = m_caster->GetPet();
|
||||
|
|
@ -1653,12 +1653,11 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
--t;
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case TARGET_ALL_ENEMY_IN_AREA:
|
||||
{
|
||||
FillAreaTargets(TagUnitMap,m_targets.m_destX, m_targets.m_destY,radius,PUSH_DEST_CENTER,SPELL_TARGETS_AOE_DAMAGE);
|
||||
break;
|
||||
}
|
||||
case TARGET_ALL_ENEMY_IN_AREA:
|
||||
FillAreaTargets(TagUnitMap,m_targets.m_destX, m_targets.m_destY,radius,PUSH_DEST_CENTER,SPELL_TARGETS_AOE_DAMAGE);
|
||||
break;
|
||||
case TARGET_AREAEFFECT_INSTANT:
|
||||
{
|
||||
SpellTargets targetB = SPELL_TARGETS_AOE_DAMAGE;
|
||||
|
|
@ -1670,6 +1669,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
|
||||
// exclude caster
|
||||
TagUnitMap.remove(m_caster);
|
||||
break;
|
||||
}
|
||||
case TARGET_ALL_ENEMY_IN_AREA_INSTANT:
|
||||
{
|
||||
|
|
@ -1681,7 +1681,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
// exclude caster (this can be important if this not original caster)
|
||||
TagUnitMap.remove(m_caster);
|
||||
}
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_DUELVSPLAYER_COORDINATES:
|
||||
{
|
||||
if(Unit* currentTarget = m_targets.getUnitTarget())
|
||||
|
|
@ -1689,7 +1690,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
m_targets.setDestination(currentTarget->GetPositionX(), currentTarget->GetPositionY(), currentTarget->GetPositionZ());
|
||||
TagUnitMap.push_back(currentTarget);
|
||||
}
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_ALL_PARTY_AROUND_CASTER:
|
||||
case TARGET_ALL_PARTY_AROUND_CASTER_2:
|
||||
case TARGET_ALL_PARTY:
|
||||
|
|
@ -1707,16 +1709,14 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
}
|
||||
case TARGET_SINGLE_FRIEND:
|
||||
case TARGET_SINGLE_FRIEND_2:
|
||||
{
|
||||
if(m_targets.getUnitTarget())
|
||||
TagUnitMap.push_back(m_targets.getUnitTarget());
|
||||
}break;
|
||||
break;
|
||||
case TARGET_NONCOMBAT_PET:
|
||||
{
|
||||
if(Unit* target = m_targets.getUnitTarget())
|
||||
if( target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isPet() && ((Pet*)target)->getPetType() == MINI_PET)
|
||||
TagUnitMap.push_back(target);
|
||||
}break;
|
||||
break;
|
||||
case TARGET_CASTER_COORDINATES:
|
||||
{
|
||||
// Check original caster is GO - set its coordinates as dst cast
|
||||
|
|
@ -1727,7 +1727,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
caster = m_caster;
|
||||
// Set dest for targets
|
||||
m_targets.setDestination(caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ());
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER:
|
||||
// special target order
|
||||
if (m_spellInfo->Id==64904) // Hymn of Hope
|
||||
|
|
@ -1793,12 +1794,12 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
}
|
||||
}
|
||||
}
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_GAMEOBJECT:
|
||||
{
|
||||
if(m_targets.getGOTarget())
|
||||
AddGOTarget(m_targets.getGOTarget(), i);
|
||||
}break;
|
||||
break;
|
||||
case TARGET_IN_FRONT_OF_CASTER:
|
||||
{
|
||||
bool inFront = m_spellInfo->SpellVisual[0] != 3879;
|
||||
|
|
@ -1823,33 +1824,27 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
}
|
||||
}
|
||||
}
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_GAMEOBJECT_ITEM:
|
||||
{
|
||||
if(m_targets.getGOTargetGUID())
|
||||
AddGOTarget(m_targets.getGOTarget(), i);
|
||||
else if(m_targets.getItemTarget())
|
||||
AddItemTarget(m_targets.getItemTarget(), i);
|
||||
break;
|
||||
}
|
||||
case TARGET_MASTER:
|
||||
{
|
||||
if(Unit* owner = m_caster->GetCharmerOrOwner())
|
||||
TagUnitMap.push_back(owner);
|
||||
break;
|
||||
}
|
||||
case TARGET_ALL_ENEMY_IN_AREA_CHANNELED:
|
||||
{
|
||||
// targets the ground, not the units in the area
|
||||
if (m_spellInfo->Effect[i]!=SPELL_EFFECT_PERSISTENT_AREA_AURA)
|
||||
FillAreaTargets(TagUnitMap, m_targets.m_destX, m_targets.m_destY, radius, PUSH_DEST_CENTER, SPELL_TARGETS_AOE_DAMAGE);
|
||||
break;
|
||||
}
|
||||
case TARGET_MINION:
|
||||
{
|
||||
if(m_spellInfo->Effect[i] != SPELL_EFFECT_DUEL)
|
||||
TagUnitMap.push_back(m_caster);
|
||||
}break;
|
||||
break;
|
||||
case TARGET_SINGLE_ENEMY:
|
||||
{
|
||||
if(Unit* pUnitTarget = m_caster->SelectMagnetTarget(m_targets.getUnitTarget(), m_spellInfo))
|
||||
|
|
@ -1857,7 +1852,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
m_targets.setUnitTarget(pUnitTarget);
|
||||
TagUnitMap.push_back(pUnitTarget);
|
||||
}
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_AREAEFFECT_PARTY:
|
||||
{
|
||||
Unit* owner = m_caster->GetCharmerOrOwner();
|
||||
|
|
@ -1922,19 +1918,19 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
if( m_caster->IsWithinDistInMap(pet, radius) )
|
||||
TagUnitMap.push_back(pet);
|
||||
}
|
||||
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_SCRIPT:
|
||||
{
|
||||
if(m_targets.getUnitTarget())
|
||||
TagUnitMap.push_back(m_targets.getUnitTarget());
|
||||
if(m_targets.getItemTarget())
|
||||
AddItemTarget(m_targets.getItemTarget(), i);
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_SELF_FISHING:
|
||||
{
|
||||
TagUnitMap.push_back(m_caster);
|
||||
}break;
|
||||
break;
|
||||
case TARGET_CHAIN_HEAL:
|
||||
{
|
||||
Unit* pUnitTarget = m_targets.getUnitTarget();
|
||||
|
|
@ -1994,7 +1990,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
--t;
|
||||
}
|
||||
}
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_CURRENT_ENEMY_COORDINATES:
|
||||
{
|
||||
Unit* currentTarget = m_targets.getUnitTarget();
|
||||
|
|
@ -2044,7 +2041,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
}
|
||||
else
|
||||
sLog.outError( "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id );
|
||||
}break;
|
||||
break;
|
||||
}
|
||||
case TARGET_BEHIND_VICTIM:
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
|
|
@ -2071,12 +2069,10 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
break;
|
||||
}
|
||||
case TARGET_DYNAMIC_OBJECT_COORDINATES:
|
||||
{
|
||||
// if parent spell create dynamic object extract area from it
|
||||
if(DynamicObject* dynObj = m_caster->GetDynObject(m_triggeredByAuraSpell ? m_triggeredByAuraSpell->Id : m_spellInfo->Id))
|
||||
m_targets.setDestination(dynObj->GetPositionX(), dynObj->GetPositionY(), dynObj->GetPositionZ());
|
||||
break;
|
||||
}
|
||||
case TARGET_DIRECTLY_FORWARD:
|
||||
{
|
||||
if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue