mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
fix(Core/Spells): Far Sight auras are supposed to extend view distance and allows seeing objects from further distance (#7068)
- Closes #5793.
This commit is contained in:
@@ -15154,3 +15154,29 @@ void Player::SetServerSideVisibilityDetect(ServerSideVisibilityType type, Accoun
|
||||
|
||||
m_serverSideVisibilityDetect.SetValue(type, sec);
|
||||
}
|
||||
|
||||
void Player::SetFarSightDistance(float radius)
|
||||
{
|
||||
_farSightDistance = radius;
|
||||
}
|
||||
|
||||
void Player::ResetFarSightDistance()
|
||||
{
|
||||
_farSightDistance.reset();
|
||||
}
|
||||
|
||||
Optional<float> Player::GetFarSightDistance() const
|
||||
{
|
||||
return _farSightDistance;
|
||||
}
|
||||
|
||||
float Player::GetSightRange(const WorldObject* target) const
|
||||
{
|
||||
float sightRange = WorldObject::GetSightRange(target);
|
||||
if (_farSightDistance)
|
||||
{
|
||||
sightRange += *_farSightDistance;
|
||||
}
|
||||
|
||||
return sightRange;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "KillRewarder.h"
|
||||
#include "MapReference.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Optional.h"
|
||||
#include "PetDefines.h"
|
||||
#include "PlayerTaxi.h"
|
||||
#include "QuestDef.h"
|
||||
@@ -2521,7 +2522,13 @@ public:
|
||||
std::string GetMapAreaAndZoneString();
|
||||
std::string GetCoordsMapAreaAndZoneString();
|
||||
|
||||
protected:
|
||||
void SetFarSightDistance(float radius);
|
||||
void ResetFarSightDistance();
|
||||
Optional<float> GetFarSightDistance() const;
|
||||
|
||||
float GetSightRange(const WorldObject* target = nullptr) const override;
|
||||
|
||||
protected:
|
||||
// Gamemaster whisper whitelist
|
||||
WhisperListContainer WhisperList;
|
||||
|
||||
@@ -2874,6 +2881,8 @@ private:
|
||||
Creature* m_CinematicObject;
|
||||
|
||||
WorldLocation _corpseLocation;
|
||||
|
||||
Optional<float> _farSightDistance = { };
|
||||
};
|
||||
|
||||
void AddItemsSetItem(Player* player, Item* item);
|
||||
|
||||
Reference in New Issue
Block a user