fix option checking for -grid* options
authorRudolf Polzer <divverent@alientrap.org>
Sat, 1 Jan 2011 19:15:20 +0000 (20:15 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 1 Jan 2011 19:15:20 +0000 (20:15 +0100)
tools/quake3/q3map2/light.c

index a703faa..389da27 100644 (file)
@@ -2184,8 +2184,8 @@ int LightMain( int argc, char **argv )
                else if( !strcmp( argv[ i ], "-griddirectionality" ) )
                {
                        f = atof( argv[ i + 1 ] );
-                       if(f < 0) f = 0;
-                       if(f > gridAmbientDirectionality) f = gridAmbientDirectionality;
+                       if(f < gridAmbientDirectionality) f = gridAmbientDirectionality;
+                       if(f > 1) f = 1;
                        Sys_Printf( "Grid directionality is %f\n", f );
                        gridDirectionality *= f;
                        i++;
@@ -2195,7 +2195,7 @@ int LightMain( int argc, char **argv )
                {
                        f = atof( argv[ i + 1 ] );
                        if(f > gridDirectionality) f = gridDirectionality;
-                       if(f > 1) f = 1;
+                       if(f < 0) f = 0;
                        Sys_Printf( "Grid ambient directionality is %f\n", f );
                        gridAmbientDirectionality *= f;
                        i++;