diff --git a/zone/position.cpp b/zone/position.cpp index a5f0cf5f1..d7e0d48f4 100644 --- a/zone/position.cpp +++ b/zone/position.cpp @@ -63,15 +63,15 @@ xyz_heading::operator xy_location() const { return xy_location(m_X,m_Y); } -const xyz_heading xyz_heading::operator +(const xyz_location& rhs) { +const xyz_heading xyz_heading::operator +(const xyz_location& rhs) const{ return xyz_heading(m_X + rhs.m_X, m_Y + rhs.m_Y, m_Z + rhs.m_Z, m_Heading); } -const xyz_heading xyz_heading::operator +(const xy_location& rhs) { +const xyz_heading xyz_heading::operator +(const xy_location& rhs) const{ return xyz_heading(m_X + rhs.m_X, m_Y + rhs.m_Y, m_Z, m_Heading); } -const xyz_heading xyz_heading::operator -(const xyz_location& rhs) { +const xyz_heading xyz_heading::operator -(const xyz_location& rhs) const{ return xyz_heading(m_X - rhs.m_X, m_Y - rhs.m_Y, m_Z - rhs.m_Z, m_Heading); } @@ -92,7 +92,7 @@ xyz_location::operator xy_location() const { return xy_location(m_X, m_Y); } -const xyz_location xyz_location::operator -(const xyz_location& rhs) { +const xyz_location xyz_location::operator -(const xyz_location& rhs) const { return xyz_location(m_X - rhs.m_X, m_Y - rhs.m_Y, m_Z - rhs.m_Z); } diff --git a/zone/position.h b/zone/position.h index 900d2cdfe..eadd187ce 100644 --- a/zone/position.h +++ b/zone/position.h @@ -43,7 +43,7 @@ public: operator xy_location() const; - const xyz_location operator -(const xyz_location& rhs); + const xyz_location operator -(const xyz_location& rhs) const; void ABS_XYZ(); bool isOrigin() const { return m_X == 0 && m_Y == 0 && m_Z == 0;} @@ -70,10 +70,10 @@ public: operator xyz_location() const; operator xy_location() const; - const xyz_heading operator +(const xyz_location& rhs); - const xyz_heading operator +(const xy_location& rhs); + const xyz_heading operator +(const xyz_location& rhs) const; + const xyz_heading operator +(const xy_location& rhs) const; - const xyz_heading operator -(const xyz_location& rhs); + const xyz_heading operator -(const xyz_location& rhs) const; bool isOrigin() const { return m_X == 0.0f && m_Y == 0.0f && m_Z == 0.0f;} };