Fix BSP import error when q3map2_type is missing from gamepack xml 96/head
authorZack Middleton <zack@cloemail.com>
Tue, 22 May 2018 20:44:57 +0000 (15:44 -0500)
committerZack Middleton <zack@cloemail.com>
Tue, 22 May 2018 20:54:19 +0000 (15:54 -0500)
Using File -> Import... to import a BSP using a gamepack that does not
specify q3map2_type (such as the Quake 3 gamepack) resulted in a fatal
error:

    runtime error: game attribute "q3map2_type" not found in "q3.game"

The code already has a fallback to use type "quake3" if q3map2_type is
missing so don't require gamepacks to specify it.

radiant/map.cpp

index adf69f4..bedfe81 100644 (file)
@@ -1641,7 +1641,7 @@ bool Map_ImportFile(const char *filename)
 
     tryDecompile:
 
 
     tryDecompile:
 
-    const char *type = GlobalRadiant().getRequiredGameDescriptionKeyValue("q3map2_type");
+    const char *type = GlobalRadiant().getGameDescriptionKeyValue("q3map2_type");
     int n = string_length(path_get_extension(filename));
     if (n && (extension_equal(path_get_extension(filename), "bsp") ||
               extension_equal(path_get_extension(filename), "map"))) {
     int n = string_length(path_get_extension(filename));
     if (n && (extension_equal(path_get_extension(filename), "bsp") ||
               extension_equal(path_get_extension(filename), "map"))) {