diff --git a/include/SFML/System/Vector3.inl b/include/SFML/System/Vector3.inl index 69671540..9387ed4b 100644 --- a/include/SFML/System/Vector3.inl +++ b/include/SFML/System/Vector3.inl @@ -89,9 +89,9 @@ constexpr Vector3 Vector3::cwiseMul(const Vector3& rhs) const template constexpr Vector3 Vector3::cwiseDiv(const Vector3& rhs) const { - assert(rhs.x != 0); - assert(rhs.y != 0); - assert(rhs.z != 0); + assert(rhs.x != 0 && "Vector3::cwiseDiv() cannot divide by 0"); + assert(rhs.y != 0 && "Vector3::cwiseDiv() cannot divide by 0"); + assert(rhs.z != 0 && "Vector3::cwiseDiv() cannot divide by 0"); return Vector3(x / rhs.x, y / rhs.y, z / rhs.z); } diff --git a/src/SFML/System/Vector3.cpp b/src/SFML/System/Vector3.cpp index 313539fc..0d563aef 100644 --- a/src/SFML/System/Vector3.cpp +++ b/src/SFML/System/Vector3.cpp @@ -38,7 +38,7 @@ Vector3 Vector3::normalized() const { static_assert(std::is_floating_point_v, "Vector3::normalized() is only supported for floating point types"); - assert(*this != Vector3()); + assert(*this != Vector3() && "Vector3::normalized() cannot normalize a zero vector"); return (*this) / length(); }