mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +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:
|
||||||
case TARGET_AREAEFFECT_CUSTOM_2:
|
case TARGET_AREAEFFECT_CUSTOM_2:
|
||||||
case TARGET_SUMMON:
|
case TARGET_SUMMON:
|
||||||
{
|
|
||||||
TagUnitMap.push_back(m_caster);
|
TagUnitMap.push_back(m_caster);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case TARGET_RANDOM_ENEMY_CHAIN_IN_AREA:
|
case TARGET_RANDOM_ENEMY_CHAIN_IN_AREA:
|
||||||
{
|
{
|
||||||
m_targets.m_targetMask = 0;
|
m_targets.m_targetMask = 0;
|
||||||
|
|
@ -1506,7 +1504,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
||||||
|
|
||||||
--t;
|
--t;
|
||||||
}
|
}
|
||||||
}break;
|
break;
|
||||||
|
}
|
||||||
case TARGET_RANDOM_FRIEND_CHAIN_IN_AREA:
|
case TARGET_RANDOM_FRIEND_CHAIN_IN_AREA:
|
||||||
{
|
{
|
||||||
m_targets.m_targetMask = 0;
|
m_targets.m_targetMask = 0;
|
||||||
|
|
@ -1573,7 +1572,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
||||||
next = tempUnitMap.begin();
|
next = tempUnitMap.begin();
|
||||||
--t;
|
--t;
|
||||||
}
|
}
|
||||||
}break;
|
break;
|
||||||
|
}
|
||||||
case TARGET_PET:
|
case TARGET_PET:
|
||||||
{
|
{
|
||||||
Pet* tmpUnit = m_caster->GetPet();
|
Pet* tmpUnit = m_caster->GetPet();
|
||||||
|
|
@ -1653,12 +1653,11 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
||||||
--t;
|
--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;
|
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:
|
case TARGET_AREAEFFECT_INSTANT:
|
||||||
{
|
{
|
||||||
SpellTargets targetB = SPELL_TARGETS_AOE_DAMAGE;
|
SpellTargets targetB = SPELL_TARGETS_AOE_DAMAGE;
|
||||||
|
|
@ -1670,6 +1669,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
||||||
|
|
||||||
// exclude caster
|
// exclude caster
|
||||||
TagUnitMap.remove(m_caster);
|
TagUnitMap.remove(m_caster);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case TARGET_ALL_ENEMY_IN_AREA_INSTANT:
|
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)
|
// exclude caster (this can be important if this not original caster)
|
||||||
TagUnitMap.remove(m_caster);
|
TagUnitMap.remove(m_caster);
|
||||||
}
|
}
|
||||||
}break;
|
break;
|
||||||
|
}
|
||||||
case TARGET_DUELVSPLAYER_COORDINATES:
|
case TARGET_DUELVSPLAYER_COORDINATES:
|
||||||
{
|
{
|
||||||
if(Unit* currentTarget = m_targets.getUnitTarget())
|
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());
|
m_targets.setDestination(currentTarget->GetPositionX(), currentTarget->GetPositionY(), currentTarget->GetPositionZ());
|
||||||
TagUnitMap.push_back(currentTarget);
|
TagUnitMap.push_back(currentTarget);
|
||||||
}
|
}
|
||||||
}break;
|
break;
|
||||||
|
}
|
||||||
case TARGET_ALL_PARTY_AROUND_CASTER:
|
case TARGET_ALL_PARTY_AROUND_CASTER:
|
||||||
case TARGET_ALL_PARTY_AROUND_CASTER_2:
|
case TARGET_ALL_PARTY_AROUND_CASTER_2:
|
||||||
case TARGET_ALL_PARTY:
|
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:
|
||||||
case TARGET_SINGLE_FRIEND_2:
|
case TARGET_SINGLE_FRIEND_2:
|
||||||
{
|
|
||||||
if(m_targets.getUnitTarget())
|
if(m_targets.getUnitTarget())
|
||||||
TagUnitMap.push_back(m_targets.getUnitTarget());
|
TagUnitMap.push_back(m_targets.getUnitTarget());
|
||||||
}break;
|
break;
|
||||||
case TARGET_NONCOMBAT_PET:
|
case TARGET_NONCOMBAT_PET:
|
||||||
{
|
|
||||||
if(Unit* target = m_targets.getUnitTarget())
|
if(Unit* target = m_targets.getUnitTarget())
|
||||||
if( target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isPet() && ((Pet*)target)->getPetType() == MINI_PET)
|
if( target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isPet() && ((Pet*)target)->getPetType() == MINI_PET)
|
||||||
TagUnitMap.push_back(target);
|
TagUnitMap.push_back(target);
|
||||||
}break;
|
break;
|
||||||
case TARGET_CASTER_COORDINATES:
|
case TARGET_CASTER_COORDINATES:
|
||||||
{
|
{
|
||||||
// Check original caster is GO - set its coordinates as dst cast
|
// 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;
|
caster = m_caster;
|
||||||
// Set dest for targets
|
// Set dest for targets
|
||||||
m_targets.setDestination(caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ());
|
m_targets.setDestination(caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ());
|
||||||
}break;
|
break;
|
||||||
|
}
|
||||||
case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER:
|
case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER:
|
||||||
// special target order
|
// special target order
|
||||||
if (m_spellInfo->Id==64904) // Hymn of Hope
|
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:
|
case TARGET_GAMEOBJECT:
|
||||||
{
|
|
||||||
if(m_targets.getGOTarget())
|
if(m_targets.getGOTarget())
|
||||||
AddGOTarget(m_targets.getGOTarget(), i);
|
AddGOTarget(m_targets.getGOTarget(), i);
|
||||||
}break;
|
break;
|
||||||
case TARGET_IN_FRONT_OF_CASTER:
|
case TARGET_IN_FRONT_OF_CASTER:
|
||||||
{
|
{
|
||||||
bool inFront = m_spellInfo->SpellVisual[0] != 3879;
|
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:
|
case TARGET_GAMEOBJECT_ITEM:
|
||||||
{
|
|
||||||
if(m_targets.getGOTargetGUID())
|
if(m_targets.getGOTargetGUID())
|
||||||
AddGOTarget(m_targets.getGOTarget(), i);
|
AddGOTarget(m_targets.getGOTarget(), i);
|
||||||
else if(m_targets.getItemTarget())
|
else if(m_targets.getItemTarget())
|
||||||
AddItemTarget(m_targets.getItemTarget(), i);
|
AddItemTarget(m_targets.getItemTarget(), i);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case TARGET_MASTER:
|
case TARGET_MASTER:
|
||||||
{
|
|
||||||
if(Unit* owner = m_caster->GetCharmerOrOwner())
|
if(Unit* owner = m_caster->GetCharmerOrOwner())
|
||||||
TagUnitMap.push_back(owner);
|
TagUnitMap.push_back(owner);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case TARGET_ALL_ENEMY_IN_AREA_CHANNELED:
|
case TARGET_ALL_ENEMY_IN_AREA_CHANNELED:
|
||||||
{
|
|
||||||
// targets the ground, not the units in the area
|
// targets the ground, not the units in the area
|
||||||
if (m_spellInfo->Effect[i]!=SPELL_EFFECT_PERSISTENT_AREA_AURA)
|
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);
|
FillAreaTargets(TagUnitMap, m_targets.m_destX, m_targets.m_destY, radius, PUSH_DEST_CENTER, SPELL_TARGETS_AOE_DAMAGE);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case TARGET_MINION:
|
case TARGET_MINION:
|
||||||
{
|
|
||||||
if(m_spellInfo->Effect[i] != SPELL_EFFECT_DUEL)
|
if(m_spellInfo->Effect[i] != SPELL_EFFECT_DUEL)
|
||||||
TagUnitMap.push_back(m_caster);
|
TagUnitMap.push_back(m_caster);
|
||||||
}break;
|
break;
|
||||||
case TARGET_SINGLE_ENEMY:
|
case TARGET_SINGLE_ENEMY:
|
||||||
{
|
{
|
||||||
if(Unit* pUnitTarget = m_caster->SelectMagnetTarget(m_targets.getUnitTarget(), m_spellInfo))
|
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);
|
m_targets.setUnitTarget(pUnitTarget);
|
||||||
TagUnitMap.push_back(pUnitTarget);
|
TagUnitMap.push_back(pUnitTarget);
|
||||||
}
|
}
|
||||||
}break;
|
break;
|
||||||
|
}
|
||||||
case TARGET_AREAEFFECT_PARTY:
|
case TARGET_AREAEFFECT_PARTY:
|
||||||
{
|
{
|
||||||
Unit* owner = m_caster->GetCharmerOrOwner();
|
Unit* owner = m_caster->GetCharmerOrOwner();
|
||||||
|
|
@ -1922,19 +1918,19 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
||||||
if( m_caster->IsWithinDistInMap(pet, radius) )
|
if( m_caster->IsWithinDistInMap(pet, radius) )
|
||||||
TagUnitMap.push_back(pet);
|
TagUnitMap.push_back(pet);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}break;
|
}
|
||||||
case TARGET_SCRIPT:
|
case TARGET_SCRIPT:
|
||||||
{
|
{
|
||||||
if(m_targets.getUnitTarget())
|
if(m_targets.getUnitTarget())
|
||||||
TagUnitMap.push_back(m_targets.getUnitTarget());
|
TagUnitMap.push_back(m_targets.getUnitTarget());
|
||||||
if(m_targets.getItemTarget())
|
if(m_targets.getItemTarget())
|
||||||
AddItemTarget(m_targets.getItemTarget(), i);
|
AddItemTarget(m_targets.getItemTarget(), i);
|
||||||
}break;
|
break;
|
||||||
|
}
|
||||||
case TARGET_SELF_FISHING:
|
case TARGET_SELF_FISHING:
|
||||||
{
|
|
||||||
TagUnitMap.push_back(m_caster);
|
TagUnitMap.push_back(m_caster);
|
||||||
}break;
|
break;
|
||||||
case TARGET_CHAIN_HEAL:
|
case TARGET_CHAIN_HEAL:
|
||||||
{
|
{
|
||||||
Unit* pUnitTarget = m_targets.getUnitTarget();
|
Unit* pUnitTarget = m_targets.getUnitTarget();
|
||||||
|
|
@ -1994,7 +1990,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
||||||
--t;
|
--t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}break;
|
break;
|
||||||
|
}
|
||||||
case TARGET_CURRENT_ENEMY_COORDINATES:
|
case TARGET_CURRENT_ENEMY_COORDINATES:
|
||||||
{
|
{
|
||||||
Unit* currentTarget = m_targets.getUnitTarget();
|
Unit* currentTarget = m_targets.getUnitTarget();
|
||||||
|
|
@ -2044,7 +2041,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sLog.outError( "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id );
|
sLog.outError( "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id );
|
||||||
}break;
|
break;
|
||||||
|
}
|
||||||
case TARGET_BEHIND_VICTIM:
|
case TARGET_BEHIND_VICTIM:
|
||||||
{
|
{
|
||||||
Unit *pTarget = NULL;
|
Unit *pTarget = NULL;
|
||||||
|
|
@ -2071,12 +2069,10 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TARGET_DYNAMIC_OBJECT_COORDINATES:
|
case TARGET_DYNAMIC_OBJECT_COORDINATES:
|
||||||
{
|
|
||||||
// if parent spell create dynamic object extract area from it
|
// if parent spell create dynamic object extract area from it
|
||||||
if(DynamicObject* dynObj = m_caster->GetDynObject(m_triggeredByAuraSpell ? m_triggeredByAuraSpell->Id : m_spellInfo->Id))
|
if(DynamicObject* dynObj = m_caster->GetDynObject(m_triggeredByAuraSpell ? m_triggeredByAuraSpell->Id : m_spellInfo->Id))
|
||||||
m_targets.setDestination(dynObj->GetPositionX(), dynObj->GetPositionY(), dynObj->GetPositionZ());
|
m_targets.setDestination(dynObj->GetPositionX(), dynObj->GetPositionY(), dynObj->GetPositionZ());
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case TARGET_DIRECTLY_FORWARD:
|
case TARGET_DIRECTLY_FORWARD:
|
||||||
{
|
{
|
||||||
if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
|
if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8177"
|
#define REVISION_NR "8178"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue