mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-29 00:18:18 +00:00
Switched out our kinda juryrigged vector types for glm::vec types since we use that as a 3d math library already but never switched out the types
This commit is contained in:
@@ -769,7 +769,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {
|
||||
float range = RangeItem->Range + AmmoItem->Range + GetRangeDistTargetSizeMod(GetTarget());
|
||||
mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range);
|
||||
range *= range;
|
||||
float dist = ComparativeDistance(m_Position, other->GetPosition());
|
||||
float dist = DistanceSquared(m_Position, other->GetPosition());
|
||||
if(dist > range) {
|
||||
mlog(COMBAT__RANGED, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range);
|
||||
Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase.
|
||||
@@ -1219,9 +1219,9 @@ void NPC::RangedAttack(Mob* other)
|
||||
min_range = static_cast<float>(sa_min_range);
|
||||
|
||||
max_range *= max_range;
|
||||
if(ComparativeDistance(m_Position, other->GetPosition()) > max_range)
|
||||
if(DistanceSquared(m_Position, other->GetPosition()) > max_range)
|
||||
return;
|
||||
else if(ComparativeDistance(m_Position, other->GetPosition()) < (min_range * min_range))
|
||||
else if(DistanceSquared(m_Position, other->GetPosition()) < (min_range * min_range))
|
||||
return;
|
||||
|
||||
if(!other || !IsAttackAllowed(other) ||
|
||||
@@ -1408,7 +1408,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51
|
||||
float range = item->Range + GetRangeDistTargetSizeMod(other);
|
||||
mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range);
|
||||
range *= range;
|
||||
float dist = ComparativeDistance(m_Position, other->GetPosition());
|
||||
float dist = DistanceSquared(m_Position, other->GetPosition());
|
||||
if(dist > range) {
|
||||
mlog(COMBAT__RANGED, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range);
|
||||
Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase.
|
||||
|
||||
Reference in New Issue
Block a user