From 72f386416f8265d866ead314898ba2c834ddc3aa Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 14 Feb 2009 16:50:14 +0000 Subject: [PATCH] fix int overflow in "loof" git-svn-id: svn://svn.icculus.org/netradiant/trunk@190 61c419a2-8eb2-4b30-bcec-8cead039b335 --- games/NexuizPack/nexuiz.game/data/entities.def | 4 ++-- libs/math/vector.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/games/NexuizPack/nexuiz.game/data/entities.def b/games/NexuizPack/nexuiz.game/data/entities.def index d306563b..09570c4d 100644 --- a/games/NexuizPack/nexuiz.game/data/entities.def +++ b/games/NexuizPack/nexuiz.game/data/entities.def @@ -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 diff --git a/libs/math/vector.h b/libs/math/vector.h index 19fdd755..23f91061 100644 --- a/libs/math/vector.h +++ b/libs/math/vector.h @@ -94,7 +94,8 @@ inline int float_to_integer(const Element& f) template 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. -- 2.39.2