From 674eacf84217540443316573a23b4f624a3180e2 Mon Sep 17 00:00:00 2001 From: Garux Date: Fri, 21 Dec 2018 14:45:12 +0300 Subject: [PATCH] q3map2: * fix map region -light compilation: load lights from .reg, not .map --- tools/quake3/q3map2/light.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index 08a977ce..fa7a9c11 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -2109,7 +2109,6 @@ void LightWorld( qboolean fastAllocate ){ int LightMain( int argc, char **argv ){ int i; float f; - char mapSource[ 1024 ]; const char *value; int lightmapMergeSize = 0; qboolean lightSamplesInsist = qfalse; @@ -2996,9 +2995,12 @@ int LightMain( int argc, char **argv ){ strcpy( source, ExpandArg( argv[ i ] ) ); StripExtension( source ); DefaultExtension( source, ".bsp" ); - strcpy( mapSource, ExpandArg( argv[ i ] ) ); - StripExtension( mapSource ); - DefaultExtension( mapSource, ".map" ); + + strcpy( name, ExpandArg( argv[ i ] ) ); + if ( strcmp( name + strlen( name ) - 4, ".reg" ) ) { /* not .reg */ + StripExtension( name ); + DefaultExtension( name, ".map" ); + } /* ydnar: set default sample size */ SetDefaultSampleSize( sampleSize ); @@ -3025,7 +3027,7 @@ int LightMain( int argc, char **argv ){ /* load map file */ value = ValueForKey( &entities[ 0 ], "_keepLights" ); if ( value[ 0 ] != '1' ) { - LoadMapFile( mapSource, qtrue, qfalse ); + LoadMapFile( name, qtrue, qfalse ); } /* set the entity/model origins and init yDrawVerts */