mirror of
https://github.com/mangosfour/server.git
synced 2025-12-22 04:37:01 +00:00
[8422] Implement far sight like spells work for long distance.
* Added basic infrastructure for visibility update in case difference player and current view point. Just for note: seletect additional arg way beacuse repeatable search object will slow but store pointer will not safe, so use middle case: get view point pointer early as possible at visibility updates. * Implement dynamic object and creature activisation while it's target of far sight spell effect * Use this for SPELL_AURA_BIND_SIGHT, SPELL_AURA_FAR_SIGHT and SPELL_EFFECT_ADD_FARSIGHT. * Note2: some spyglass like spells let look _around_ at long distance, this hard implement in current grid loading system Without additional changes and not implemented (you will see empty area without creatures in likes case) * Also fixed warning spam at CMSG_MOVE_SET_CAN_FLY_ACK receive by use proper packet sructure reading.
This commit is contained in:
parent
db1c9924a9
commit
45dd7140b5
28 changed files with 228 additions and 144 deletions
|
|
@ -445,6 +445,8 @@ class MANGOS_DLL_SPEC WorldObject : public Object
|
|||
float GetAngle( const WorldObject* obj ) const;
|
||||
float GetAngle( const float x, const float y ) const;
|
||||
bool HasInArc( const float arcangle, const WorldObject* obj ) const;
|
||||
bool isInFrontInMap(WorldObject const* target,float distance, float arc = M_PI) const;
|
||||
bool isInBackInMap(WorldObject const* target, float distance, float arc = M_PI) const;
|
||||
|
||||
virtual void CleanupsBeforeDelete(); // used in destructor or explicitly before mass creature delete to remove cross-references to already deleted units
|
||||
|
||||
|
|
@ -471,10 +473,10 @@ class MANGOS_DLL_SPEC WorldObject : public Object
|
|||
void AddObjectToRemoveList();
|
||||
|
||||
// main visibility check function in normal case (ignore grey zone distance check)
|
||||
bool isVisibleFor(Player const* u) const { return isVisibleForInState(u,false); }
|
||||
bool isVisibleFor(Player const* u, WorldObject const* viewPoint) const { return isVisibleForInState(u,viewPoint,false); }
|
||||
|
||||
// low level function for visibility change code, must be define in all main world object subclasses
|
||||
virtual bool isVisibleForInState(Player const* u, bool inVisibleList) const = 0;
|
||||
virtual bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const = 0;
|
||||
|
||||
void SetMap(Map * map);
|
||||
Map * GetMap() const { ASSERT(m_currMap); return m_currMap; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue