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:
KimLS
2015-01-23 00:01:10 -08:00
parent 03286f540a
commit 269d56e1d0
68 changed files with 1524 additions and 1692 deletions
+4 -4
View File
@@ -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.