summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTony J. White <tjw@tjw.org>2007-03-03 03:04:52 +0000
committerTony J. White <tjw@tjw.org>2007-03-03 03:04:52 +0000
commit2ed4fa4812f961d203fdfde80629238177cb236c (patch)
tree0285b1c24be06d7e32f0ee5fb1d4a0039969a8f9 /src
parentc5de1709c4f2691713d2838f818555bfea46e3b0 (diff)
* (bug 3008) track when map and map_restart commands are added to the command
buffer with level.restarted. This prevents G_RunFrame() from running until the command is processed by the server code.
Diffstat (limited to 'src')
-rw-r--r--src/game/g_admin.c1
-rw-r--r--src/game/g_main.c8
-rw-r--r--src/game/g_svcmds.c1
3 files changed, 10 insertions, 0 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index 1af65c55..fbe8eb52 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -1938,6 +1938,7 @@ qboolean G_admin_map( gentity_t *ent, int skiparg )
}
trap_SendConsoleCommand( EXEC_APPEND, va( "map %s", map ) );
+ level.restarted = qtrue;
AP( va( "print \"^3!map: ^7map '%s' started by %s %s\n\"", map,
( ent ) ? ent->client->pers.netname : "console",
( layout[ 0 ] ) ? va( "(forcing layout '%s')", layout ) : "" ) );
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 6a217bdc..e142b21a 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -661,6 +661,8 @@ void G_ShutdownGame( int restart )
G_admin_cleanup( );
G_admin_namelog_cleanup( );
+
+ level.restarted = qfalse;
}
@@ -1517,6 +1519,7 @@ void ExitLevel( void )
else
trap_SendConsoleCommand( EXEC_APPEND, "map_restart\n" );
+ level.restarted = qtrue;
level.changemap = NULL;
level.intermissiontime = 0;
@@ -1931,6 +1934,11 @@ void CheckVote( void )
level.voteExecuteTime = 0;
trap_SendConsoleCommand( EXEC_APPEND, va( "%s\n", level.voteString ) );
+ if( !Q_stricmp( level.voteString, "map_restart" ) ||
+ !Q_stricmpn( level.voteString, "map", 3 ) )
+ {
+ level.restarted = qtrue;
+ }
}
if( !level.voteTime )
diff --git a/src/game/g_svcmds.c b/src/game/g_svcmds.c
index be2a4da6..df656446 100644
--- a/src/game/g_svcmds.c
+++ b/src/game/g_svcmds.c
@@ -541,6 +541,7 @@ void Svcmd_LayoutLoad_f( void )
Q_strncpyz( layouts, s, sizeof( layouts ) );
trap_Cvar_Set( "g_layouts", layouts );
trap_SendConsoleCommand( EXEC_APPEND, "map_restart\n" );
+ level.restarted = qtrue;
}
/*