diff --git a/tools/quake3/q3map2/lightmaps_ydnar.c b/tools/quake3/q3map2/lightmaps_ydnar.c index 19791c4a..462331f1 100644 --- a/tools/quake3/q3map2/lightmaps_ydnar.c +++ b/tools/quake3/q3map2/lightmaps_ydnar.c @@ -2310,12 +2310,6 @@ static int CompareRawLightmap( const void *a, const void *b ){ /* get min number of surfaces */ min = ( alm->numLightSurfaces < blm->numLightSurfaces ? alm->numLightSurfaces : blm->numLightSurfaces ); - /* compare size, allocate bigger first */ - diff = ( blm->w * blm->h ) - ( alm->w * alm->h ); - if ( diff != 0 ) { - return diff; - } - /* iterate */ for ( i = 0; i < min; i++ ) { @@ -2338,6 +2332,12 @@ static int CompareRawLightmap( const void *a, const void *b ){ return diff; } + /* compare size */ + diff = ( blm->w * blm->h ) - ( alm->w * alm->h ); + if ( diff != 0 ) { + return diff; + } + /* must be equivalent */ return 0; }