summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-03-09 08:57:14 +0100
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:16 +0100
commit253fda567163917b0305f0df6156f22ca0a9ca70 (patch)
tree3db9971cb09268f8d2c169c25d6aa1a1f2f125fb /src/game/g_buildable.c
parent0b0e4c0db6886b98fcd593c3ca496e75c24b8a1e (diff)
add G_LayoutExists() and use it
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index a57a5adc..a5e64d36 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -4056,7 +4056,6 @@ set level.layout based on g_nextLayout, g_layouts or g_layoutAuto
*/
void G_LayoutSelect( void )
{
- char fileName[ MAX_OSPATH ];
char layouts[ ( MAX_CVAR_VALUE_STRING - 1 ) * 9 + 1 ];
char layouts2[ ( MAX_CVAR_VALUE_STRING - 1 ) * 9 + 1 ];
char *l;
@@ -4094,16 +4093,7 @@ void G_LayoutSelect( void )
if( !*s )
break;
- if( !Q_stricmp( s, "*BUILTIN*" ) )
- {
- Q_strcat( layouts, sizeof( layouts ), s );
- Q_strcat( layouts, sizeof( layouts ), " " );
- cnt++;
- continue;
- }
-
- Com_sprintf( fileName, sizeof( fileName ), "layouts/%s/%s.dat", map, s );
- if( trap_FS_FOpenFile( fileName, NULL, FS_READ ) > 0 )
+ if( G_LayoutExists( map, s ) )
{
Q_strcat( layouts, sizeof( layouts ), s );
Q_strcat( layouts, sizeof( layouts ), " " );