mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 10:37:06 +00:00
[6846] Fixed some more typos. Added post check for assistance conditions into event execute.
Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
parent
359d4d7dd3
commit
64fd2dc881
5 changed files with 40 additions and 31 deletions
|
|
@ -721,32 +721,15 @@ namespace MaNGOS
|
|||
if(u == i_funit)
|
||||
return false;
|
||||
|
||||
// we don't need help from zombies :)
|
||||
if( !u->isAlive() )
|
||||
return false;
|
||||
|
||||
// skip fighting creature
|
||||
if( u->isInCombat() )
|
||||
return false;
|
||||
|
||||
// only from same creature faction
|
||||
if(u->getFaction() != i_funit->getFaction() )
|
||||
return false;
|
||||
|
||||
// only free creature
|
||||
if( u->GetCharmerOrOwnerGUID() )
|
||||
if ( !u->CanAssistTo(i_funit, i_enemy) )
|
||||
return false;
|
||||
|
||||
// too far
|
||||
if( !i_funit->IsWithinDistInMap(u, i_range) )
|
||||
return false;
|
||||
|
||||
// skip non hostile to caster enemy creatures
|
||||
if( !u->IsHostileTo(i_enemy) )
|
||||
return false;
|
||||
|
||||
// only if see assisted creature
|
||||
if(!u->IsWithinLOSInMap(i_funit) )
|
||||
if( !i_funit->IsWithinLOSInMap(u) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue