mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Merge commit 'origin/master' into 310
Conflicts: src/game/Player.cpp
This commit is contained in:
commit
6734694a90
47 changed files with 740 additions and 524 deletions
|
|
@ -1334,7 +1334,7 @@ struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit,
|
|||
// functor for operator ">"
|
||||
bool operator()(const Unit* _Left, const Unit* _Right) const
|
||||
{
|
||||
return (MainTarget->GetDistance(_Left) < MainTarget->GetDistance(_Right));
|
||||
return MainTarget->GetDistanceOrder(_Left,_Right);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1427,7 +1427,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
//Now to get us a random target that's in the initial range of the spell
|
||||
uint32 t = 0;
|
||||
std::list<Unit *>::iterator itr = tempUnitMap.begin();
|
||||
while(itr!= tempUnitMap.end() && (*itr)->GetDistance(m_caster) < radius)
|
||||
while(itr!= tempUnitMap.end() && (*itr)->IsWithinDist(m_caster,radius))
|
||||
++t, ++itr;
|
||||
|
||||
if(!t)
|
||||
|
|
@ -1448,7 +1448,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
|
||||
while(t && next != tempUnitMap.end() )
|
||||
{
|
||||
if(prev->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS)
|
||||
if(!prev->IsWithinDist(*next,CHAIN_SPELL_JUMP_RADIUS))
|
||||
break;
|
||||
|
||||
if(!prev->IsWithinLOSInMap(*next))
|
||||
|
|
@ -1496,7 +1496,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
//Now to get us a random target that's in the initial range of the spell
|
||||
uint32 t = 0;
|
||||
std::list<Unit *>::iterator itr = tempUnitMap.begin();
|
||||
while(itr!= tempUnitMap.end() && (*itr)->GetDistance(m_caster) < radius)
|
||||
while(itr!= tempUnitMap.end() && (*itr)->IsWithinDist(m_caster,radius))
|
||||
++t, ++itr;
|
||||
|
||||
if(!t)
|
||||
|
|
@ -1517,7 +1517,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
|
||||
while(t && next != tempUnitMap.end() )
|
||||
{
|
||||
if(prev->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS)
|
||||
if(!prev->IsWithinDist(*next,CHAIN_SPELL_JUMP_RADIUS))
|
||||
break;
|
||||
|
||||
if(!prev->IsWithinLOSInMap(*next))
|
||||
|
|
@ -1602,7 +1602,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
|
||||
while(t && next != tempUnitMap.end() )
|
||||
{
|
||||
if(prev->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS)
|
||||
if(!prev->IsWithinDist(*next,CHAIN_SPELL_JUMP_RADIUS))
|
||||
break;
|
||||
|
||||
if(!prev->IsWithinLOSInMap(*next))
|
||||
|
|
@ -2029,7 +2029,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
|
||||
while(t && next != tempUnitMap.end() )
|
||||
{
|
||||
if(prev->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS)
|
||||
if(!prev->IsWithinDist(*next,CHAIN_SPELL_JUMP_RADIUS))
|
||||
break;
|
||||
|
||||
if(!prev->IsWithinLOSInMap(*next))
|
||||
|
|
@ -4688,10 +4688,9 @@ SpellCastResult Spell::CheckRange(bool strict)
|
|||
|
||||
if(m_targets.m_targetMask == TARGET_FLAG_DEST_LOCATION && m_targets.m_destX != 0 && m_targets.m_destY != 0 && m_targets.m_destZ != 0)
|
||||
{
|
||||
float dist = m_caster->GetDistance(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ);
|
||||
if(dist > max_range)
|
||||
if(!m_caster->IsWithinDist3d(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ,max_range))
|
||||
return SPELL_FAILED_OUT_OF_RANGE;
|
||||
if(dist < min_range)
|
||||
if(m_caster->IsWithinDist3d(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ,min_range))
|
||||
return SPELL_FAILED_TOO_CLOSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue