From 9f786f4defbc01787cc414171408491449b7b3ca Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Tue, 8 Feb 2011 18:06:39 +0000 Subject: [PATCH] - A few code cleanups in gamecode - Add a bit of stuff from Zakk Middleton --- code/cgame/cg_servercmds.c | 1 + code/game/g_cmds.c | 39 +++++++++++++++++--------------------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/code/cgame/cg_servercmds.c b/code/cgame/cg_servercmds.c index 7761646e..a38136b7 100644 --- a/code/cgame/cg_servercmds.c +++ b/code/cgame/cg_servercmds.c @@ -459,6 +459,7 @@ static void CG_MapRestart( void ) { cg.timelimitWarnings = 0; cg.intermissionStarted = qfalse; + cg.levelShot = qfalse; cgs.voteTime = 0; diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index aa79ba48..23c3afdc 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -385,38 +385,34 @@ and sends over a command to the client to resize the view, hide the scoreboard, and take a special screenshot ================== */ -void Cmd_LevelShot_f( gentity_t *ent ) { - if ( !CheatsOk( ent ) ) { - return; - } - - // doesn't work in single player - if ( g_gametype.integer != 0 ) { - trap_SendServerCommand( ent-g_entities, - "print \"Must be in g_gametype 0 for levelshot\n\"" ); - return; - } - +void Cmd_LevelShot_f(gentity_t *ent) +{ if(!ent->client->pers.localClient) { trap_SendServerCommand(ent-g_entities, - "print \"The levelshot command must be executed by a local client\n\""); + "print \"The levelshot command must be executed by a local client\n\""); return; } - + + if(!CheatsOk(ent)) + return; + + // doesn't work in single player + if(g_gametype.integer == GT_SINGLE_PLAYER) + { + trap_SendServerCommand(ent-g_entities, + "print \"Must not be in singleplayer mode for levelshot\n\"" ); + return; + } + BeginIntermission(); - trap_SendServerCommand( ent-g_entities, "clientLevelShot" ); + trap_SendServerCommand(ent-g_entities, "clientLevelShot"); } /* ================== -Cmd_LevelShot_f - -This is just to help generate the level pictures -for the menus. It goes to the intermission immediately -and sends over a command to the client to resize the view, -hide the scoreboard, and take a special screenshot +Cmd_TeamTask_f ================== */ void Cmd_TeamTask_f( gentity_t *ent ) { @@ -438,7 +434,6 @@ void Cmd_TeamTask_f( gentity_t *ent ) { } - /* ================= Cmd_Kill_f