mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 21:56:22 +00:00
fix(Core/Player): Vertical Message distance (#19302)
* cherry-pick commit (297541e9c9)
* Get rid of unused param
* Merge SendMessageToSetInRange_OwnTeam into SendMessageToSetInRange
Co-authored-by: Badgersson <83663557+dekz120@users.noreply.github.com>
This commit is contained in:
@@ -217,8 +217,14 @@ void MessageDistDeliverer::Visit(PlayerMapType& m)
|
||||
if (!target->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (target->GetExactDist2dSq(i_source) > i_distSq)
|
||||
continue;
|
||||
if (required3dDist)
|
||||
{
|
||||
if (target->GetExactDistSq(i_source) > i_distSq)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
if (target->GetExactDist2dSq(i_source) > i_distSq)
|
||||
continue;
|
||||
|
||||
// Send packet to all who are sharing the player's vision
|
||||
if (target->HasSharedVision())
|
||||
@@ -242,8 +248,14 @@ void MessageDistDeliverer::Visit(CreatureMapType& m)
|
||||
if (!target->HasSharedVision() || !target->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (target->GetExactDist2dSq(i_source) > i_distSq)
|
||||
continue;
|
||||
if (required3dDist)
|
||||
{
|
||||
if (target->GetExactDistSq(i_source) > i_distSq)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
if (target->GetExactDist2dSq(i_source) > i_distSq)
|
||||
continue;
|
||||
|
||||
// Send packet to all who are sharing the creature's vision
|
||||
SharedVisionList::const_iterator i = target->GetSharedVisionList().begin();
|
||||
@@ -265,8 +277,14 @@ void MessageDistDeliverer::Visit(DynamicObjectMapType& m)
|
||||
if (!target->IsViewpoint())
|
||||
continue;
|
||||
|
||||
if (target->GetExactDist2dSq(i_source) > i_distSq)
|
||||
continue;
|
||||
if (required3dDist)
|
||||
{
|
||||
if (target->GetExactDistSq(i_source) > i_distSq)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
if (target->GetExactDist2dSq(i_source) > i_distSq)
|
||||
continue;
|
||||
|
||||
// Send packet back to the caster if the caster has vision of dynamic object
|
||||
Player* caster = (Player*)target->GetCaster();
|
||||
|
||||
@@ -102,10 +102,11 @@ namespace Acore
|
||||
float i_distSq;
|
||||
TeamId teamId;
|
||||
Player const* skipped_receiver;
|
||||
MessageDistDeliverer(WorldObject const* src, WorldPacket const* msg, float dist, bool own_team_only = false, Player const* skipped = nullptr)
|
||||
bool required3dDist;
|
||||
MessageDistDeliverer(WorldObject const* src, WorldPacket const* msg, float dist, bool own_team_only = false, Player const* skipped = nullptr, bool req3dDist = false)
|
||||
: i_source(src), i_message(msg), i_phaseMask(src->GetPhaseMask()), i_distSq(dist * dist)
|
||||
, teamId((own_team_only && src->GetTypeId() == TYPEID_PLAYER) ? src->ToPlayer()->GetTeamId() : TEAM_NEUTRAL)
|
||||
, skipped_receiver(skipped)
|
||||
, skipped_receiver(skipped), required3dDist(req3dDist)
|
||||
{
|
||||
}
|
||||
void Visit(PlayerMapType& m);
|
||||
|
||||
Reference in New Issue
Block a user