diff --git a/code/cgame/cg_consolecmds.c b/code/cgame/cg_consolecmds.c index 0d29588f..0c2842d0 100644 --- a/code/cgame/cg_consolecmds.c +++ b/code/cgame/cg_consolecmds.c @@ -24,8 +24,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // executed by a key binding #include "cg_local.h" -#include "../ui/ui_shared.h" #ifdef MISSIONPACK +#include "../ui/ui_shared.h" extern menuDef_t *menuScoreboard; #endif @@ -210,6 +210,7 @@ static void CG_TellAttacker_f( void ) { trap_SendClientCommand( command ); } +#ifdef MISSIONPACK static void CG_VoiceTellTarget_f( void ) { int clientNum; char command[128]; @@ -240,7 +241,6 @@ static void CG_VoiceTellAttacker_f( void ) { trap_SendClientCommand( command ); } -#ifdef MISSIONPACK static void CG_NextTeamMember_f( void ) { CG_SelectNextPlayer(); } @@ -467,12 +467,12 @@ static consoleCommand_t commands[] = { { "weapnext", CG_NextWeapon_f }, { "weapprev", CG_PrevWeapon_f }, { "weapon", CG_Weapon_f }, + { "tcmd", CG_TargetCommand_f }, { "tell_target", CG_TellTarget_f }, { "tell_attacker", CG_TellAttacker_f }, +#ifdef MISSIONPACK { "vtell_target", CG_VoiceTellTarget_f }, { "vtell_attacker", CG_VoiceTellAttacker_f }, - { "tcmd", CG_TargetCommand_f }, -#ifdef MISSIONPACK { "loadhud", CG_LoadHud_f }, { "nextTeamMember", CG_NextTeamMember_f }, { "prevTeamMember", CG_PrevTeamMember_f }, @@ -552,6 +552,7 @@ void CG_InitConsoleCommands( void ) { trap_AddCommand ("say"); trap_AddCommand ("say_team"); trap_AddCommand ("tell"); +#ifdef MISSIONPACK trap_AddCommand ("vsay"); trap_AddCommand ("vsay_team"); trap_AddCommand ("vtell"); @@ -559,6 +560,7 @@ void CG_InitConsoleCommands( void ) { trap_AddCommand ("vosay"); trap_AddCommand ("vosay_team"); trap_AddCommand ("votell"); +#endif trap_AddCommand ("give"); trap_AddCommand ("god"); trap_AddCommand ("notarget"); diff --git a/code/cgame/cg_local.h b/code/cgame/cg_local.h index 6f0a52f8..3e5c7908 100644 --- a/code/cgame/cg_local.h +++ b/code/cgame/cg_local.h @@ -590,10 +590,12 @@ typedef struct { int soundTime; qhandle_t soundBuffer[MAX_SOUNDBUFFER]; +#ifdef MISSIONPACK // for voice chat buffer int voiceChatTime; int voiceChatBufferIn; int voiceChatBufferOut; +#endif // warmup countdown int warmup; @@ -1145,8 +1147,10 @@ extern vmCvar_t cg_predictItems; extern vmCvar_t cg_deferPlayers; extern vmCvar_t cg_drawFriend; extern vmCvar_t cg_teamChatsOnly; +#ifdef MISSIONPACK extern vmCvar_t cg_noVoiceChats; extern vmCvar_t cg_noVoiceText; +#endif extern vmCvar_t cg_scorePlum; extern vmCvar_t cg_smoothClients; extern vmCvar_t pmove_fixed; @@ -1445,10 +1449,12 @@ void CG_InitConsoleCommands( void ); void CG_ExecuteNewServerCommands( int latestSequence ); void CG_ParseServerinfo( void ); void CG_SetConfigValues( void ); -void CG_LoadVoiceChats( void ); void CG_ShaderStateChanged(void); +#ifdef MISSIONPACK +void CG_LoadVoiceChats( void ); void CG_VoiceChatLocal( int mode, qboolean voiceOnly, int clientNum, int color, const char *cmd ); void CG_PlayBufferedVoiceChats( void ); +#endif // // cg_playerstate.c diff --git a/code/cgame/cg_main.c b/code/cgame/cg_main.c index 0d8e3188..43a44f06 100644 --- a/code/cgame/cg_main.c +++ b/code/cgame/cg_main.c @@ -158,8 +158,10 @@ vmCvar_t cg_drawTeamOverlay; vmCvar_t cg_teamOverlayUserinfo; vmCvar_t cg_drawFriend; vmCvar_t cg_teamChatsOnly; +#ifdef MISSIONPACK vmCvar_t cg_noVoiceChats; vmCvar_t cg_noVoiceText; +#endif vmCvar_t cg_hudFiles; vmCvar_t cg_scorePlum; vmCvar_t cg_smoothClients; @@ -272,8 +274,10 @@ static cvarTable_t cvarTable[] = { { &cg_stats, "cg_stats", "0", 0 }, { &cg_drawFriend, "cg_drawFriend", "1", CVAR_ARCHIVE }, { &cg_teamChatsOnly, "cg_teamChatsOnly", "0", CVAR_ARCHIVE }, +#ifdef MISSIONPACK { &cg_noVoiceChats, "cg_noVoiceChats", "0", CVAR_ARCHIVE }, { &cg_noVoiceText, "cg_noVoiceText", "0", CVAR_ARCHIVE }, +#endif // the following variables are created in other parts of the system, // but we also reference them here { &cg_buildScript, "com_buildScript", "0", 0 }, // force loading of all possible data amd error on failures diff --git a/code/cgame/cg_servercmds.c b/code/cgame/cg_servercmds.c index 28147c64..e9ed778c 100644 --- a/code/cgame/cg_servercmds.c +++ b/code/cgame/cg_servercmds.c @@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // be a valid snapshot this frame #include "cg_local.h" +#ifdef MISSIONPACK #include "../../ui/menudef.h" typedef struct { @@ -46,7 +47,6 @@ static const orderTask_t validOrders[] = { static const int numValidOrders = ARRAY_LEN(validOrders); -#ifdef MISSIONPACK static int CG_ValidOrder(const char *p) { int i; for (i = 0; i < numValidOrders; i++) { @@ -487,6 +487,8 @@ static void CG_MapRestart( void ) { trap_Cvar_Set("cg_thirdPerson", "0"); } +#ifdef MISSIONPACK + #define MAX_VOICEFILESIZE 16384 #define MAX_VOICEFILES 8 #define MAX_VOICECHATS 64 @@ -940,7 +942,6 @@ CG_VoiceChat ================= */ void CG_VoiceChat( int mode ) { -#ifdef MISSIONPACK const char *cmd; int clientNum, color; qboolean voiceOnly; @@ -959,8 +960,8 @@ void CG_VoiceChat( int mode ) { } CG_VoiceChatLocal( mode, voiceOnly, clientNum, color, cmd ); -#endif } +#endif /* ================= @@ -1040,6 +1041,8 @@ static void CG_ServerCommand( void ) { CG_Printf( "%s\n", text ); return; } + +#ifdef MISSIONPACK if ( !strcmp( cmd, "vchat" ) ) { CG_VoiceChat( SAY_ALL ); return; @@ -1054,6 +1057,7 @@ static void CG_ServerCommand( void ) { CG_VoiceChat( SAY_TELL ); return; } +#endif if ( !strcmp( cmd, "scores" ) ) { CG_ParseScores(); diff --git a/code/cgame/cg_view.c b/code/cgame/cg_view.c index fe7f4a1a..0fc763a9 100644 --- a/code/cgame/cg_view.c +++ b/code/cgame/cg_view.c @@ -818,8 +818,10 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo // add buffered sounds CG_PlayBufferedSounds(); +#ifdef MISSIONPACK // play buffered voice chats CG_PlayBufferedVoiceChats(); +#endif // finish up the rest of the refdef if ( cg.testModelEntity.hModel ) { diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index 9d6794ea..e1147e86 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -22,7 +22,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "g_local.h" +#ifdef MISSIONPACK #include "../../ui/menudef.h" // for the voice chats +#endif /* ================== @@ -937,6 +939,7 @@ static void Cmd_Tell_f( gentity_t *ent ) { } +#ifdef MISSIONPACK static void G_VoiceTo( gentity_t *ent, gentity_t *other, int mode, const char *id, qboolean voiceonly ) { int color; char *cmd; @@ -1132,6 +1135,7 @@ static void Cmd_VoiceTaunt_f( gentity_t *ent ) { // just say something G_Voice( ent, NULL, SAY_ALL, VOICECHAT_TAUNT, qfalse ); } +#endif @@ -1605,6 +1609,7 @@ void ClientCommand( int clientNum ) { Cmd_Tell_f ( ent ); return; } +#ifdef MISSIONPACK if (Q_stricmp (cmd, "vsay") == 0) { Cmd_Voice_f (ent, SAY_ALL, qfalse, qfalse); return; @@ -1633,6 +1638,7 @@ void ClientCommand( int clientNum ) { Cmd_VoiceTaunt_f ( ent ); return; } +#endif if (Q_stricmp (cmd, "score") == 0) { Cmd_Score_f (ent); return;