From e68f44435279e9556ed5ad7d70b2bdb3cc997a06 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 20 Nov 2007 20:43:35 +0000 Subject: [PATCH] changed FogPoint_World/Model code to use unsigned int instead of signed int, this fixes a crash reported by Andreas Dehmel in certain quoth maps, I have no idea how coordinates can be negative though git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7708 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index 577e6fb4..29cb7cbd 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -249,13 +249,13 @@ void FOG_clear(void) float FogPoint_World(const vec3_t p) { - int fogmasktableindex = (int)(VectorDistance((p), r_view.origin) * r_refdef.fogmasktabledistmultiplier); + unsigned int fogmasktableindex = (unsigned int)(VectorDistance((p), r_view.origin) * r_refdef.fogmasktabledistmultiplier); return r_refdef.fogmasktable[min(fogmasktableindex, FOGMASKTABLEWIDTH - 1)]; } float FogPoint_Model(const vec3_t p) { - int fogmasktableindex = (int)(VectorDistance((p), rsurface.modelorg) * r_refdef.fogmasktabledistmultiplier); + unsigned int fogmasktableindex = (unsigned int)(VectorDistance((p), rsurface.modelorg) * r_refdef.fogmasktabledistmultiplier); return r_refdef.fogmasktable[min(fogmasktableindex, FOGMASKTABLEWIDTH - 1)]; } -- 2.39.2