[quake3-commits] r1873 - in trunk/code: cgame game

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Feb 8 13:06:40 EST 2011


Author: thilo
Date: 2011-02-08 13:06:39 -0500 (Tue, 08 Feb 2011)
New Revision: 1873

Modified:
   trunk/code/cgame/cg_servercmds.c
   trunk/code/game/g_cmds.c
Log:
- A few code cleanups in gamecode
- Add a bit of stuff from Zakk Middleton


Modified: trunk/code/cgame/cg_servercmds.c
===================================================================
--- trunk/code/cgame/cg_servercmds.c	2011-02-08 17:58:31 UTC (rev 1872)
+++ trunk/code/cgame/cg_servercmds.c	2011-02-08 18:06:39 UTC (rev 1873)
@@ -459,6 +459,7 @@
 	cg.timelimitWarnings = 0;
 
 	cg.intermissionStarted = qfalse;
+	cg.levelShot = qfalse;
 
 	cgs.voteTime = 0;
 

Modified: trunk/code/game/g_cmds.c
===================================================================
--- trunk/code/game/g_cmds.c	2011-02-08 17:58:31 UTC (rev 1872)
+++ trunk/code/game/g_cmds.c	2011-02-08 18:06:39 UTC (rev 1873)
@@ -385,38 +385,34 @@
 hide the scoreboard, and take a special screenshot
 ==================
 */
-void Cmd_LevelShot_f( gentity_t *ent ) {
-	if ( !CheatsOk( ent ) ) {
+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\"");
 		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\"" );
+	if(!CheatsOk(ent))
 		return;
-	}
 
-	if(!ent->client->pers.localClient)
+	// doesn't work in single player
+	if(g_gametype.integer == GT_SINGLE_PLAYER)
 	{
 		trap_SendServerCommand(ent-g_entities,
-		"print \"The levelshot command must be executed by a local client\n\"");
+			"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 @@
 }
 
 
-
 /*
 =================
 Cmd_Kill_f



More information about the quake3-commits mailing list