]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
q3map2: fix dds/ prefixed dds image loading, don't break following formats
authorThomas Debesse <dev@illwieckz.net>
Sun, 19 Jun 2022 21:48:39 +0000 (23:48 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sun, 19 Jun 2022 21:48:39 +0000 (23:48 +0200)
The dds/ prefix was mistakenly kept for ktx, crn and and webp loading.

tools/quake3/q3map2/image.c

index aacf9d0b85c8edbb1855cdbef6aaf4d07ecb2f49..f5c0b1e90f7c4082bad7b6e41785e545087c282a 100644 (file)
@@ -479,11 +479,12 @@ image_t *ImageLoad( const char *filename ){
 
                /* also look for .dds image in dds/ prefix like Doom3 or DarkPlaces */
                if ( size <= 0 ) {
-                       strcpy( name, "dds/" );
-                       strcat( name, image->name );
-                       StripExtension( name );
-                       strcat( name, ".dds" );
-                       size = vfsLoadFile( (const char*) name, (void**) &buffer, 0 );
+                       char ddsname[ 1024 ];
+                       strcpy( ddsname, "dds/" );
+                       strcat( ddsname, image->name );
+                       StripExtension( ddsname );
+                       strcat( ddsname, ".dds" );
+                       size = vfsLoadFile( (const char*) ddsname, (void**) &buffer, 0 );
                }
 
                if ( size > 0 ) {