diff --git a/tools/quake3/q3map2/map.c b/tools/quake3/q3map2/map.c index 1bd3bcb36..a7eed1b7a 100644 --- a/tools/quake3/q3map2/map.c +++ b/tools/quake3/q3map2/map.c @@ -1052,8 +1052,12 @@ static void ParseRawBrush( qboolean onlyLights ){ /* ydnar: gs mods: bias texture shift */ if ( si->globalTexture == qfalse ) { - shift[ 0 ] -= ( floor( shift[ 0 ] / si->shaderWidth ) * si->shaderWidth ); - shift[ 1 ] -= ( floor( shift[ 1 ] / si->shaderHeight ) * si->shaderHeight ); + if ( si->shaderWidth > 0 ) { + shift[ 0 ] -= ( floor( shift[ 0 ] / si->shaderWidth ) * si->shaderWidth ); + } + if ( si->shaderHeight ) { + shift[ 1 ] -= ( floor( shift[ 1 ] / si->shaderHeight ) * si->shaderHeight ); + } } /*