]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
changed FogPoint_World/Model code to use unsigned int instead of signed
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 20 Nov 2007 20:43:35 +0000 (20:43 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 20 Nov 2007 20:43:35 +0000 (20:43 +0000)
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

index 577e6fb457167d04c012101ded47aa9b87a71ff2..29cb7cbd1a64258c1e4283dda0f6745e6f4159a9 100644 (file)
@@ -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)];
 }