mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +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
|
class AnyAoETargetUnitInObjectRangeCheck
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range)
|
AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, bool hitHidden = true)
|
||||||
: i_obj(obj), i_funit(funit), i_range(range)
|
: i_obj(obj), i_funit(funit), i_range(range), i_hitHidden(hitHidden)
|
||||||
{
|
{
|
||||||
Unit const* check = i_funit;
|
Unit const* check = i_funit;
|
||||||
Unit const* owner = i_funit->GetOwner();
|
Unit const* owner = i_funit->GetOwner();
|
||||||
|
|
@ -863,6 +863,8 @@ namespace MaNGOS
|
||||||
return false;
|
return false;
|
||||||
if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->isTotem())
|
if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->isTotem())
|
||||||
return false;
|
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))
|
if(( i_targetForPlayer ? !i_funit->IsFriendlyTo(u) : i_funit->IsHostileTo(u) )&& i_obj->IsWithinDistInMap(u, i_range))
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -870,6 +872,7 @@ namespace MaNGOS
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
bool i_hitHidden;
|
||||||
bool i_targetForPlayer;
|
bool i_targetForPlayer;
|
||||||
WorldObject const* i_obj;
|
WorldObject const* i_obj;
|
||||||
Unit const* i_funit;
|
Unit const* i_funit;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7956"
|
#define REVISION_NR "7957"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue