summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-03-09 08:51:38 +0100
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:15 +0100
commit639639c22d45eda949809446e4c29e0ed4c7d290 (patch)
tree3a79a65c71b3c168632af132b7f9d38da0b21368 /src/game/g_buildable.c
parent7b0078d927d4685d41fdff91a54c91dafad38644 (diff)
rename g_layouts to g_nextLayout; add a different set of cvars: g_layouts, g_layouts2, ..., g_layouts9
also remove the latching property
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 1425e539..a57a5adc 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -4051,25 +4051,30 @@ int G_LayoutList( const char *map, char *list, int len )
============
G_LayoutSelect
-set level.layout based on g_layouts or g_layoutAuto
+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 ];
- char layouts2[ MAX_CVAR_VALUE_STRING ];
+ char layouts[ ( MAX_CVAR_VALUE_STRING - 1 ) * 9 + 1 ];
+ char layouts2[ ( MAX_CVAR_VALUE_STRING - 1 ) * 9 + 1 ];
char *l;
char map[ MAX_QPATH ];
char *s;
int cnt = 0;
int layoutNum;
- Q_strncpyz( layouts, g_layouts.string, sizeof( layouts ) );
+ Q_strncpyz( layouts, g_nextLayout.string, sizeof( layouts ) );
+ if( !layouts[ 0 ] )
+ {
+ for( layoutNum = 0; layoutNum < 9; ++layoutNum )
+ Q_strcat( layouts, sizeof( layouts ), g_layouts[ layoutNum ].string );
+ }
trap_Cvar_VariableStringBuffer( "mapname", map, sizeof( map ) );
// one time use cvar
- trap_Cvar_Set( "g_layouts", "" );
+ trap_Cvar_Set( "g_nextLayout", "" );
// pick an included layout at random if no list has been provided
if( !layouts[ 0 ] && g_layoutAuto.integer )