]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
fix int overflow in "loof"
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Sat, 14 Feb 2009 16:50:14 +0000 (16:50 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Sat, 14 Feb 2009 16:50:14 +0000 (16:50 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@190 61c419a2-8eb2-4b30-bcec-8cead039b335

games/NexuizPack/nexuiz.game/data/entities.def
libs/math/vector.h

index d306563b08638770173140cc936d646a182c601e..09570c4da3f8e3c1254e8f6e5027ee35c0e09afc 100644 (file)
@@ -375,7 +375,7 @@ FLOATING: the item will float in air, instead of aligning to the floor by fallin
 model="models/items/a_cells.md3"
 */
 
-/*QUAKED item_flag_team1 (1 0 0) (-32 -32 -37) (32 32 37
+/*QUAKED item_flag_team1 (1 0 0) (-32 -32 0) (32 32 74
 CTF flag for team one (Red). Use more than one if you really insist.
 -------- KEYS --------
 model: model to use
@@ -388,7 +388,7 @@ noise3: sound played when flag is lost in the field and respawns itself
 zbqry="zbqryf/pgs/enqvnag/synt_erq_enqvnag.zq3"
 */
 
-/*QUAKED item_flag_team2 (0 0 1) (-32 -32 -37) (32 32 37
+/*QUAKED item_flag_team2 (0 0 1) (-32 -32 0) (32 32 74
 CTF flag for team two (Blue). Use more than one if you really insist.
 -------- KEYS --------
 model: model to use
index 19fdd755925c48f470be85f983ed62672965dfb4..23f910618b5cb86598b2cf0b1ac4982b5605143d 100644 (file)
@@ -94,7 +94,8 @@ inline int float_to_integer(const Element& f)
 template<typename Element, typename OtherElement>
 inline Element float_snapped(const Element& f, const OtherElement& snap)
 {
-  return Element(float_to_integer(f / snap) * snap);
+  //return Element(float_to_integer(f / snap) * snap);
+  return Element(llrint(f / snap) * snap); // llrint has more significant bits
 }
 
 /// \brief Returns true if \p f has no decimal fraction part.