summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/g_admin.c10
-rw-r--r--src/game/g_buildable.c14
-rw-r--r--src/game/g_spawn.c2
3 files changed, 19 insertions, 7 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index f16c961a..515192b7 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -1907,8 +1907,9 @@ qboolean G_admin_map( gentity_t *ent, int skiparg )
if( G_SayArgc( ) > 2 + skiparg )
{
G_SayArgv( skiparg + 2, layout, sizeof( layout ) );
- if( trap_FS_FOpenFile( va( "layouts/%s/%s.dat", map, layout ),
- NULL, FS_READ ) > 0 )
+ if( !Q_stricmp( layout, "*BUILTIN*" ) ||
+ trap_FS_FOpenFile( va( "layouts/%s/%s.dat", map, layout ),
+ NULL, FS_READ ) > 0 )
{
trap_Cvar_Set( "g_layouts", layout );
}
@@ -2643,8 +2644,9 @@ qboolean G_admin_restart( gentity_t *ent, int skiparg )
trap_Cvar_VariableStringBuffer( "mapname", map, sizeof( map ) );
G_SayArgv( skiparg + 1, layout, sizeof( layout ) );
- if( trap_FS_FOpenFile( va( "layouts/%s/%s.dat", map, layout ),
- NULL, FS_READ ) > 0 )
+ if( !Q_stricmp( layout, "*BUILTIN*" ) ||
+ trap_FS_FOpenFile( va( "layouts/%s/%s.dat", map, layout ),
+ NULL, FS_READ ) > 0 )
{
trap_Cvar_Set( "g_layouts", layout );
}
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 727be461..1737b73c 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -3379,7 +3379,8 @@ int G_LayoutList( const char *map, char *list, int len )
int numFiles, i, fileLen = 0, listLen;
int count = 0;
char *filePtr;
-
+
+ Q_strcat( layouts, sizeof( layouts ), "*BUILTIN* " );
numFiles = trap_FS_GetFileList( va( "layouts/%s", map ), ".dat",
fileList, sizeof( fileList ) );
filePtr = fileList;
@@ -3451,6 +3452,15 @@ void G_LayoutSelect( void )
s = COM_ParseExt( &l, qfalse );
while( *s )
{
+ if( !Q_stricmp( s, "*BUILTIN*" ) )
+ {
+ Q_strcat( layouts, sizeof( layouts ), s );
+ Q_strcat( layouts, sizeof( layouts ), " " );
+ cnt++;
+ s = COM_ParseExt( &l, qfalse );
+ continue;
+ }
+
Com_sprintf( fileName, sizeof( fileName ), "layouts/%s/%s.dat", map, s );
if( trap_FS_FOpenFile( fileName, NULL, FS_READ ) > 0 )
{
@@ -3521,7 +3531,7 @@ void G_LayoutLoad( void )
char line[ MAX_STRING_CHARS ];
int i = 0;
- if( !level.layout[ 0 ] )
+ if( !level.layout[ 0 ] || !Q_stricmp( level.layout, "*BUILTIN*" ) )
return;
trap_Cvar_VariableStringBuffer( "mapname", map, sizeof( map ) );
diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c
index aee0cfd5..29b6a3e4 100644
--- a/src/game/g_spawn.c
+++ b/src/game/g_spawn.c
@@ -328,7 +328,7 @@ qboolean G_CallSpawn( gentity_t *ent )
if( ( buildable = BG_FindBuildNumForEntityName( ent->classname ) ) != BA_NONE )
{
// don't spawn built-in buildings if we are using a custom layout
- if( level.layout[ 0 ] )
+ if( level.layout[ 0 ] && Q_stricmp( level.layout, "*BUILTIN*" ) )
return qtrue;
if( buildable == BA_A_SPAWN || buildable == BA_H_SPAWN )