mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[7957] Implemented for AnyAoETargetUnitInObjectRangeCheck possibility to allow/disallow selecting hidden units.
Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
parent
0a413723ec
commit
72f16ab342
2 changed files with 6 additions and 3 deletions
|
|
@ -847,8 +847,8 @@ namespace MaNGOS
|
|||
class AnyAoETargetUnitInObjectRangeCheck
|
||||
{
|
||||
public:
|
||||
AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range)
|
||||
: i_obj(obj), i_funit(funit), i_range(range)
|
||||
AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, bool hitHidden = true)
|
||||
: i_obj(obj), i_funit(funit), i_range(range), i_hitHidden(hitHidden)
|
||||
{
|
||||
Unit const* check = i_funit;
|
||||
Unit const* owner = i_funit->GetOwner();
|
||||
|
|
@ -863,6 +863,8 @@ namespace MaNGOS
|
|||
return false;
|
||||
if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->isTotem())
|
||||
return false;
|
||||
if (!i_hitHidden && !u->isVisibleForOrDetect(i_funit, false))
|
||||
return false;
|
||||
|
||||
if(( i_targetForPlayer ? !i_funit->IsFriendlyTo(u) : i_funit->IsHostileTo(u) )&& i_obj->IsWithinDistInMap(u, i_range))
|
||||
return true;
|
||||
|
|
@ -870,6 +872,7 @@ namespace MaNGOS
|
|||
return false;
|
||||
}
|
||||
private:
|
||||
bool i_hitHidden;
|
||||
bool i_targetForPlayer;
|
||||
WorldObject const* i_obj;
|
||||
Unit const* i_funit;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7956"
|
||||
#define REVISION_NR "7957"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue