[svn] Rewrite canSeeOrDetect function.
Minor change on trigger creatures. Remove some unused hacks in scripts. --HG-- branch : trunk
This commit is contained in:
+5
-3
@@ -437,8 +437,8 @@ enum UnitVisibility
|
||||
VISIBILITY_OFF = 0, // absolute, not detectable, GM-like, can see all other
|
||||
VISIBILITY_ON = 1,
|
||||
VISIBILITY_GROUP_STEALTH = 2, // detect chance, seen and can see group members
|
||||
VISIBILITY_GROUP_INVISIBILITY = 3, // invisibility, can see and can be seen only another invisible unit or invisible detection unit, set only if not stealthed, and in checks not used (mask used instead)
|
||||
VISIBILITY_GROUP_NO_DETECT = 4, // state just at stealth apply for update Grid state. Don't remove, otherwise stealth spells will break
|
||||
//VISIBILITY_GROUP_INVISIBILITY = 3, // invisibility, can see and can be seen only another invisible unit or invisible detection unit, set only if not stealthed, and in checks not used (mask used instead)
|
||||
//VISIBILITY_GROUP_NO_DETECT = 4, // state just at stealth apply for update Grid state. Don't remove, otherwise stealth spells will break
|
||||
VISIBILITY_RESPAWN = 5 // special totally not detectable visibility for force delete object at respawn command
|
||||
};
|
||||
|
||||
@@ -1135,13 +1135,15 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
void SetVisibility(UnitVisibility x);
|
||||
|
||||
// common function for visibility checks for player/creatures with detection code
|
||||
virtual bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList) const;
|
||||
bool isVisibleForOrDetect(Unit const* u, bool detect, bool inVisibleList = false) const;
|
||||
bool canDetectInvisibilityOf(Unit const* u) const;
|
||||
bool canDetectStealthOf(Unit const* u, float distance) const;
|
||||
|
||||
// virtual functions for all world objects types
|
||||
bool isVisibleForInState(Player const* u, bool inVisibleList) const;
|
||||
// function for low level grid visibility checks in player/creature cases
|
||||
virtual bool IsVisibleInGridForPlayer(Player* pl) const = 0;
|
||||
virtual bool IsVisibleInGridForPlayer(Player const* pl) const = 0;
|
||||
|
||||
bool waterbreath;
|
||||
AuraList & GetSingleCastAuras() { return m_scAuras; }
|
||||
|
||||
Reference in New Issue
Block a user