diff options
Diffstat (limited to 'src/game/GridNotifiers.h')
-rw-r--r-- | src/game/GridNotifiers.h | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index 6b4dd39306c..ac68db6ba1e 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -10,12 +10,12 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef TRINITY_GRIDNOTIFIERS_H @@ -476,7 +476,7 @@ namespace Trinity return false; } - template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED* u) { return false; } + template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; } private: Unit* const i_funit; float i_range; @@ -771,35 +771,15 @@ namespace Trinity 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; - - if(!u->isAggressive()) - 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; |