diff --git a/include/common/aabb.hh b/include/common/aabb.hh index 5b5c3ac3..f555f04d 100644 --- a/include/common/aabb.hh +++ b/include/common/aabb.hh @@ -147,12 +147,26 @@ public: constexpr V &operator[](const size_t &index) { - return (index == 0 ? m_mins : index == 1 ? m_maxs : throw std::exception()); + switch (index) { + case 0: + return m_mins; + case 1: + return m_maxs; + default: + throw std::exception(); + } } constexpr const V &operator[](const size_t &index) const { - return (index == 0 ? m_mins : index == 1 ? m_maxs : throw std::exception()); + switch (index) { + case 0: + return m_mins; + case 1: + return m_maxs; + default: + throw std::exception(); + } } constexpr V centroid() const { return (m_mins + m_maxs) * 0.5; } diff --git a/qbsp/map.cc b/qbsp/map.cc index 5ce5cfc9..40a187b5 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -772,7 +772,7 @@ static texdef_quake_ed_t TexDef_BSPToQuakeEd( const texdef_quake_ed_noshift_t res = Reverse_QuakeEd(texPlaneToUV, &faceplane, false); // figure out shift based on facepoints[0] - const qvec3f &testpoint = facepoints[0]; + const qvec3f testpoint = facepoints[0]; qvec2f uv0_actual = evalTexDefAtPoint(addShift(res, qvec2f(0, 0)), &faceplane, testpoint); qvec2f uv0_desired = qvec2f(worldToTexSpace * qvec4f(testpoint[0], testpoint[1], testpoint[2], 1.0f)); qvec2f shift = uv0_desired - uv0_actual;