diff options
author | Christopher Schwarz <lakitu7@gmail.com> | 2010-12-08 20:02:11 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:17:47 +0000 |
commit | 733c839dc1ed0524c669ee0a2f366f9c0967c10a (patch) | |
tree | 57bced0bc838ac081c9bf6d40c1da873d330de5f /src/game/g_main.c | |
parent | 419fef4d61933c1b4cb01d3bfe3f9a62496bec7b (diff) |
* (bug 4815) Add /pause admin command
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r-- | src/game/g_main.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c index ae9486a3..6bdbdea9 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -2275,14 +2275,37 @@ Advances the non-player objects in the world */ void G_RunFrame( int levelTime ) { - int i; - gentity_t *ent; - int msec; + int i; + gentity_t *ent; + int msec; + static int ptime3000 = 0; // if we are waiting for the level to restart, do nothing if( level.restarted ) return; + if( level.pausedTime ) + { + msec = levelTime - level.time - level.pausedTime; + level.pausedTime = levelTime - level.time; + + ptime3000 += msec; + while( ptime3000 > 3000 ) + { + ptime3000 -= 3000; + trap_SendServerCommand( -1, "cp \"The game has been paused. Please wait.\"" ); + } + + // Prevents clients from getting lagged-out messages + for( i = 0; i < level.maxclients; i++ ) + { + if( level.clients[ i ].pers.connected == CON_CONNECTED ) + level.clients[ i ].ps.commandTime = levelTime; + } + + return; + } + level.framenum++; level.previousTime = level.time; level.time = levelTime; |