]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/math/vector.h
ToggleGridSnap command (beware of it)
[xonotic/netradiant.git] / libs / math / vector.h
index 57022dbb516354a157c9d043a0e6f8bcc8f40b0a..075c58fe9ee7446711b942fab277b120c5220f4d 100644 (file)
@@ -105,6 +105,8 @@ template<typename Element, typename OtherElement>
 inline Element float_snapped(const Element& f, const OtherElement& snap)
 {
   //return Element(float_to_integer(f / snap) * snap);
+  if(snap == 0)
+       return f;
   return Element(llrint(f / snap) * snap); // llrint has more significant bits
 }