]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
reduced number of GAME_NEXUIZ checks in the engine (added cl_sound and sv_sound cvars...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 28 Feb 2006 05:41:39 +0000 (05:41 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 28 Feb 2006 05:41:39 +0000 (05:41 +0000)
k prevents you from even reaching the singleplayer menu)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6043 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
clvm_cmds.c
gl_rmain.c
host.c
menu.c
snd_main.c
sv_phys.c

index a99cb1930324fa65fad14a66dbba02322cc9f879..0cfdd68e32d3929b02b9ea7014439bc5ae718214 100644 (file)
@@ -157,6 +157,13 @@ char *qw_svc_strings[128] =
 
 cvar_t demo_nehahra = {0, "demo_nehahra", "0", "reads all quake demos as nehahra movie protocol"};
 cvar_t developer_networkentities = {0, "developer_networkentities", "0", "prints received entities, value is 0-4 (higher for more info)"};
+cvar_t cl_sound_wizardhit = {0, "cl_sound_wizardhit", "wizard/hit.wav", "sound to play during TE_WIZSPIKE (empty cvar disables sound)"};
+cvar_t cl_sound_hknighthit = {0, "cl_sound_hknighthit", "hknight/hit.wav", "sound to play during TE_KNIGHTSPIKE (empty cvar disables sound)"};
+cvar_t cl_sound_tink1 = {0, "cl_sound_tink1", "1", "sound to play with 80% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"};
+cvar_t cl_sound_ric1 = {0, "cl_sound_ric1", "1", "sound to play with 5% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"};
+cvar_t cl_sound_ric2 = {0, "cl_sound_ric2", "1", "sound to play with 5% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"};
+cvar_t cl_sound_ric3 = {0, "cl_sound_ric3", "1", "sound to play with 10% chance during TE_SPIKE/TE_SUPERSPIKE (empty cvar disables sound)"};
+cvar_t cl_sound_r_exp3 = {0, "cl_sound_r_exp3", "1", "sound to play during TE_EXPLOSION and related effects (empty cvar disables sound)"};
 
 static qboolean QW_CL_CheckOrDownloadFile(const char *filename);
 static void QW_CL_RequestNextDownload(void);
@@ -520,13 +527,13 @@ static void QW_CL_RequestNextDownload(void)
                S_ServerSounds(cl.sound_name, cls.qw_downloadnumber);
 
                // precache any sounds used by the client
-               cl.sfx_wizhit = S_PrecacheSound("sound/wizard/hit.wav", false, true);
-               cl.sfx_knighthit = S_PrecacheSound("sound/hknight/hit.wav", false, true);
-               cl.sfx_tink1 = S_PrecacheSound("sound/weapons/tink1.wav", false, true);
-               cl.sfx_ric1 = S_PrecacheSound("sound/weapons/ric1.wav", false, true);
-               cl.sfx_ric2 = S_PrecacheSound("sound/weapons/ric2.wav", false, true);
-               cl.sfx_ric3 = S_PrecacheSound("sound/weapons/ric3.wav", false, true);
-               cl.sfx_r_exp3 = S_PrecacheSound("sound/weapons/r_exp3.wav", false, true);
+               cl.sfx_wizhit = S_PrecacheSound(cl_sound_wizardhit.string, false, true);
+               cl.sfx_knighthit = S_PrecacheSound(cl_sound_hknighthit.string, false, true);
+               cl.sfx_tink1 = S_PrecacheSound(cl_sound_tink1.string, false, true);
+               cl.sfx_ric1 = S_PrecacheSound(cl_sound_ric1.string, false, true);
+               cl.sfx_ric2 = S_PrecacheSound(cl_sound_ric2.string, false, true);
+               cl.sfx_ric3 = S_PrecacheSound(cl_sound_ric3.string, false, true);
+               cl.sfx_r_exp3 = S_PrecacheSound(cl_sound_r_exp3.string, false, true);
 
                // sounds
                for (i = 1;i < MAX_SOUNDS && cl.sound_name[i][0];i++)
@@ -853,7 +860,7 @@ static void QW_CL_ParseNails(void)
        }
 }
 
-static void QW_CL_UpdateItemsAndWeapon(void)
+static void CL_UpdateItemsAndWeapon(void)
 {
        int j;
        // check for important changes
@@ -1111,13 +1118,13 @@ void CL_ParseServerInfo (void)
                S_ServerSounds (cl.sound_name, numsounds);
 
                // precache any sounds used by the client
-               cl.sfx_wizhit = S_PrecacheSound("sound/wizard/hit.wav", false, true);
-               cl.sfx_knighthit = S_PrecacheSound("sound/hknight/hit.wav", false, true);
-               cl.sfx_tink1 = S_PrecacheSound("sound/weapons/tink1.wav", false, true);
-               cl.sfx_ric1 = S_PrecacheSound("sound/weapons/ric1.wav", false, true);
-               cl.sfx_ric2 = S_PrecacheSound("sound/weapons/ric2.wav", false, true);
-               cl.sfx_ric3 = S_PrecacheSound("sound/weapons/ric3.wav", false, true);
-               cl.sfx_r_exp3 = S_PrecacheSound("sound/weapons/r_exp3.wav", false, true);
+               cl.sfx_wizhit = S_PrecacheSound(cl_sound_wizardhit.string, false, true);
+               cl.sfx_knighthit = S_PrecacheSound(cl_sound_hknighthit.string, false, true);
+               cl.sfx_tink1 = S_PrecacheSound(cl_sound_tink1.string, false, true);
+               cl.sfx_ric1 = S_PrecacheSound(cl_sound_ric1.string, false, true);
+               cl.sfx_ric2 = S_PrecacheSound(cl_sound_ric2.string, false, true);
+               cl.sfx_ric3 = S_PrecacheSound(cl_sound_ric3.string, false, true);
+               cl.sfx_r_exp3 = S_PrecacheSound(cl_sound_r_exp3.string, false, true);
 
                // now we try to load everything that is new
 
@@ -1289,7 +1296,7 @@ Server information pertaining to this client only
 */
 void CL_ParseClientdata (void)
 {
-       int i, j, bits;
+       int i, bits;
 
        VectorCopy (cl.mpunchangle[0], cl.mpunchangle[1]);
        VectorCopy (cl.mpunchvector[0], cl.mpunchvector[1]);
@@ -1397,20 +1404,6 @@ void CL_ParseClientdata (void)
                        cl.stats[STAT_VIEWZOOM] = (unsigned short) MSG_ReadShort();
        }
 
-       // check for important changes
-
-       // set flash times
-       if (cl.olditems != cl.stats[STAT_ITEMS])
-               for (j = 0;j < 32;j++)
-                       if ((cl.stats[STAT_ITEMS] & (1<<j)) && !(cl.olditems & (1<<j)))
-                               cl.item_gettime[j] = cl.time;
-       cl.olditems = cl.stats[STAT_ITEMS];
-
-       // GAME_NEXUIZ hud needs weapon change time
-       if (cl.activeweapon != cl.stats[STAT_ACTIVEWEAPON])
-               cl.weapontime = cl.time;
-       cl.activeweapon = cl.stats[STAT_ACTIVEWEAPON];
-
        // viewzoom interpolation
        cl.mviewzoom[0] = (float) max(cl.stats[STAT_VIEWZOOM], 2) * (1.0f / 255.0f);
 }
@@ -1664,8 +1657,7 @@ void CL_ParseTempEntity(void)
                        // LordHavoc: boosted color from 1.0, 0.8, 0.4 to 1.25, 1.0, 0.5
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                        CL_AllocDlight(NULL, &tempmatrix, 350, 4.0f, 2.0f, 0.50f, 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-                       if (gamemode != GAME_NEXUIZ)
-                               S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
+                       S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        CL_Effect(pos, cl.qw_modelindex_s_explod, 0, 6, 10);
                        break;
 
@@ -1675,8 +1667,7 @@ void CL_ParseTempEntity(void)
                        CL_FindNonSolidLocation(pos, pos, 10);
                        CL_BlobExplosion(pos);
 
-                       if (gamemode != GAME_NEXUIZ)
-                               S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
+                       S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                        CL_AllocDlight(NULL, &tempmatrix, 600, 1.6f, 0.8f, 2.0f, 1200, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                        break;
@@ -1977,8 +1968,7 @@ void CL_ParseTempEntity(void)
                        // LordHavoc: boosted color from 1.0, 0.8, 0.4 to 1.25, 1.0, 0.5
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                        CL_AllocDlight(NULL, &tempmatrix, 350, 4.0f, 2.0f, 0.50f, 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-                       if (gamemode != GAME_NEXUIZ)
-                               S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
+                       S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        break;
 
                case TE_EXPLOSIONQUAD:
@@ -1988,8 +1978,7 @@ void CL_ParseTempEntity(void)
                        CL_ParticleExplosion(pos);
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                        CL_AllocDlight(NULL, &tempmatrix, 350, 2.5f, 2.0f, 4.0f, 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-                       if (gamemode != GAME_NEXUIZ)
-                               S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
+                       S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        break;
 
                case TE_EXPLOSION3:
@@ -2002,8 +1991,7 @@ void CL_ParseTempEntity(void)
                        color[1] = MSG_ReadCoord(cls.protocol) * (2.0f / 1.0f);
                        color[2] = MSG_ReadCoord(cls.protocol) * (2.0f / 1.0f);
                        CL_AllocDlight(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-                       if (gamemode != GAME_NEXUIZ)
-                               S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
+                       S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        break;
 
                case TE_EXPLOSIONRGB:
@@ -2016,8 +2004,7 @@ void CL_ParseTempEntity(void)
                        color[2] = MSG_ReadByte() * (2.0f / 255.0f);
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                        CL_AllocDlight(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-                       if (gamemode != GAME_NEXUIZ)
-                               S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
+                       S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        break;
 
                case TE_TAREXPLOSION:
@@ -2026,8 +2013,7 @@ void CL_ParseTempEntity(void)
                        CL_FindNonSolidLocation(pos, pos, 10);
                        CL_BlobExplosion(pos);
 
-                       if (gamemode != GAME_NEXUIZ)
-                               S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
+                       S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                        CL_AllocDlight(NULL, &tempmatrix, 600, 1.6f, 0.8f, 2.0f, 1200, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                        break;
@@ -2110,8 +2096,7 @@ void CL_ParseTempEntity(void)
                        color[2] = tempcolor[2] * (2.0f / 255.0f);
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                        CL_AllocDlight(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-                       if (gamemode != GAME_NEXUIZ)
-                               S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
+                       S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        break;
 
                case TE_TEI_G3:
@@ -2135,8 +2120,7 @@ void CL_ParseTempEntity(void)
                        CL_ParticleExplosion(pos);
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                        CL_AllocDlight(NULL, &tempmatrix, 500, 2.5f, 2.0f, 1.0f, 500, 9999, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-                       if (gamemode != GAME_NEXUIZ)
-                               S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
+                       S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        break;
 
                case TE_TEI_PLASMAHIT:
@@ -2527,8 +2511,6 @@ void CL_ParseServerMessage(void)
                for (i = 1;i < cl.maxclients;i++)
                        if (!cl_entities_active[i])
                                cl_entities[i].state_current.active = false;
-
-               QW_CL_UpdateItemsAndWeapon();
        }
        else
        {
@@ -2935,6 +2917,8 @@ void CL_ParseServerMessage(void)
                }
        }
 
+       CL_UpdateItemsAndWeapon();
+
        EntityFrameQuake_ISeeDeadEntities();
 
        parsingerror = false;
@@ -2968,6 +2952,14 @@ void CL_Parse_Init(void)
                Cvar_SetValue("demo_nehahra", 1);
        Cvar_RegisterVariable(&developer_networkentities);
 
+       Cvar_RegisterVariable(&cl_sound_wizardhit);
+       Cvar_RegisterVariable(&cl_sound_hknighthit);
+       Cvar_RegisterVariable(&cl_sound_tink1);
+       Cvar_RegisterVariable(&cl_sound_ric1);
+       Cvar_RegisterVariable(&cl_sound_ric2);
+       Cvar_RegisterVariable(&cl_sound_ric3);
+       Cvar_RegisterVariable(&cl_sound_r_exp3);
+
        Cmd_AddCommand("nextul", QW_CL_NextUpload, "sends next fragment of current upload buffer (screenshot for example)");
        Cmd_AddCommand("stopul", QW_CL_StopUpload, "aborts current upload (screenshot for example)");
        Cmd_AddCommand("skins", QW_CL_Skins_f, "downloads missing qw skins from server");
index 67bb45ef96bbb5a2b9a7f5721da5c3012cbebee6..e828cdc0c6775f52ce6cbd9de7c21e23ed020c6c 100644 (file)
@@ -1680,8 +1680,7 @@ void VM_CL_te_explosionquad (void)
        CL_ParticleExplosion(pos2);
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
        CL_AllocDlight(NULL, &tempmatrix, 350, 2.5f, 2.0f, 4.0f, 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-       if (gamemode != GAME_NEXUIZ)
-               S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
+       S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
 }
 
 // #416 void(vector org) te_smallflash (DP_TE_SMALLFLASH)
@@ -1791,8 +1790,7 @@ void VM_CL_te_explosion (void)
        CL_ParticleExplosion(pos2);
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
        CL_AllocDlight(NULL, &tempmatrix, 350, 4.0f, 2.0f, 0.50f, 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-       if (gamemode != GAME_NEXUIZ)
-               S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
+       S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
 }
 
 // #422 void(vector org) te_tarexplosion (DP_TE_STANDARDEFFECTBUILTINS)
@@ -1808,8 +1806,7 @@ void VM_CL_te_tarexplosion (void)
        CL_BlobExplosion(pos2);
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
        CL_AllocDlight(NULL, &tempmatrix, 600, 1.6f, 0.8f, 2.0f, 1200, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-       if (gamemode != GAME_NEXUIZ)
-               S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
+       S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
 }
 
 // #423 void(vector org) te_wizspike (DP_TE_STANDARDEFFECTBUILTINS)
@@ -1885,8 +1882,7 @@ void VM_CL_te_explosion2 (void)
        color[2] = tempcolor[2] * (2.0f / 255.0f);
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
        CL_AllocDlight(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-       if (gamemode != GAME_NEXUIZ)
-               S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
+       S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
 }
 
 
index b2c5683df8c1dd7e8418690658d8a99e4020c5b4..45ee836993b3910cafa12f8c8920633fc35746b5 100644 (file)
@@ -482,7 +482,7 @@ void GL_Main_Init(void)
        Cvar_RegisterVariable(&developer_texturelogging);
        Cvar_RegisterVariable(&gl_lightmaps);
        Cvar_RegisterVariable(&r_test);
-       if (gamemode == GAME_NEHAHRA || gamemode == GAME_NEXUIZ || gamemode == GAME_TENEBRAE)
+       if (gamemode == GAME_NEHAHRA || gamemode == GAME_TENEBRAE)
                Cvar_SetValue("r_fullbrights", 0);
        R_RegisterModule("GL_Main", gl_main_start, gl_main_shutdown, gl_main_newmap);
 }
diff --git a/host.c b/host.c
index 05dcd78a3473481980f979266e1bab4b0d09ed15..c0a8d30c95a62bc9d07eeb7649b58b4be3307439 100644 (file)
--- a/host.c
+++ b/host.c
@@ -1016,8 +1016,6 @@ void Host_Init (void)
                Cbuf_AddText("alias startmap_sp \"map nehstart\"\nalias startmap_dm \"map nehstart\"\nexec quake.rc\n");
        else if (gamemode == GAME_TRANSFUSION)
                Cbuf_AddText("alias startmap_sp \"map e1m1\"\n""alias startmap_dm \"map bb1\"\nexec quake.rc\n");
-       else if (gamemode == GAME_NEXUIZ)
-               Cbuf_AddText("alias startmap_sp \"map nexdm01\"\nalias startmap_dm \"map nexdm01\"\nexec quake.rc\n");
        else if (gamemode == GAME_TEU)
                Cbuf_AddText("alias startmap_sp \"map start\"\nalias startmap_dm \"map start\"\nexec teu.rc\n");
        else
diff --git a/menu.c b/menu.c
index 459736ae5c03d22905700af6dd1bb72043216dc9..587644dba708831ccd7a71a9d4a70b5f1b75eaf0 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -444,8 +444,8 @@ void M_Main_Draw (void)
                M_Background(640, 480); //fall back is always to 640x480, this makes it most readable at that.
                M_PrintRed (40, (480/3)-16, "You have reached this menu due to missing or unlocatable content/data");
                M_Print ((640/2)-92, (480/3), "You may consider adding");
-               M_Print ((640/2)-136, (480/3)+8, "-basedir /path/to/your/nexuiz/data");
-               M_Print ((640/2)-76, (480/3)+16, "to your launch path");
+               M_Print ((640/2)-136, (480/3)+8, "-basedir /path/to/nexuiz");
+               M_Print ((640/2)-76, (480/3)+16, "to your launch commandline");
                M_Print (640/2 - 48, 480/2, "Open Console"); //The console usually better shows errors (failures)
                M_Print (640/2 - 48, 480/2 + 8, "Quit");
                M_DrawCharacter(640/2 - 56, 480/2 + (8 * m_main_cursor), 12+((int)(realtime*4)&1));
@@ -754,14 +754,12 @@ void M_SinglePlayer_Draw (void)
        p = Draw_CachePic ("gfx/ttl_sgl", false);
 
        // Some mods don't have a single player mode
-       if (gamemode == GAME_NEXUIZ || gamemode == GAME_GOODVSBAD2 || gamemode == GAME_BATTLEMECH)
+       if (gamemode == GAME_GOODVSBAD2 || gamemode == GAME_BATTLEMECH)
        {
                M_DrawPic ((320 - p->width) / 2, 4, "gfx/ttl_sgl");
 
                M_DrawTextBox (60, 8 * 8, 23, 4);
-               if (gamemode == GAME_NEXUIZ)
-                       M_Print(95, 10 * 8, "Nexuiz is for");
-               else if (gamemode == GAME_GOODVSBAD2)
+               if (gamemode == GAME_GOODVSBAD2)
                        M_Print(95, 10 * 8, "Good Vs Bad 2 is for");
                else  // if (gamemode == GAME_BATTLEMECH)
                        M_Print(95, 10 * 8, "Battlemech is for");
@@ -783,7 +781,7 @@ void M_SinglePlayer_Draw (void)
 
 void M_SinglePlayer_Key (int key, char ascii)
 {
-       if (gamemode == GAME_NEXUIZ || gamemode == GAME_GOODVSBAD2 || gamemode == GAME_BATTLEMECH)
+       if (gamemode == GAME_GOODVSBAD2 || gamemode == GAME_BATTLEMECH)
        {
                if (key == K_ESCAPE || key == K_ENTER)
                        m_state = m_main;
index 33918a36d44791e7fd8a6f5581814818f0fb24ae..186fc0e56836f9d46d1682258fe02ea2d5af7770 100644 (file)
@@ -416,6 +416,9 @@ sfx_t *S_PrecacheSound (const char *name, qboolean complain, qboolean lock)
        if (!snd_initialized.integer)
                return NULL;
 
+       if (name == NULL || name[0] == 0)
+               return NULL;
+
        sfx = S_FindName (name);
        if (sfx == NULL)
                return NULL;
index e505b28949676e0c6c359d6dc7f5ddeef6369156..1e58ea8b8b0b97b76d8080cca7f9d8c8ac09a149 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -51,6 +51,9 @@ cvar_t sv_newflymove = {CVAR_NOTIFY, "sv_newflymove", "0", "enables simpler/bugg
 cvar_t sv_freezenonclients = {CVAR_NOTIFY, "sv_freezenonclients", "0", "freezes time, except for players, allowing you to walk around and take screenshots of explosions"};
 cvar_t sv_playerphysicsqc = {CVAR_NOTIFY, "sv_playerphysicsqc", "1", "enables QuakeC function to override player physics"};
 
+cvar_t sv_sound_watersplash = {0, "sv_sound_watersplash", "misc/h2ohit1.wav", "sound to play when MOVETYPE_FLY/TOSS/BOUNCE/STEP entity enters or leaves water (empty cvar disables the sound)"};
+cvar_t sv_sound_land = {0, "sv_sound_land", "demon/dland2.wav", "sound to play when MOVETYPE_STEP entity hits the ground at high speed (empty cvar disables the sound)"};
+
 #define        MOVE_EPSILON    0.01
 
 void SV_Physics_Toss (prvm_edict_t *ent);
@@ -64,6 +67,9 @@ void SV_Phys_Init (void)
        Cvar_RegisterVariable(&sv_freezenonclients);
 
        Cvar_RegisterVariable(&sv_playerphysicsqc);
+
+       Cvar_RegisterVariable(&sv_sound_watersplash);
+       Cvar_RegisterVariable(&sv_sound_land);
 }
 
 /*
@@ -1199,8 +1205,8 @@ void SV_CheckWaterTransition (prvm_edict_t *ent)
        }
 
        // check if the entity crossed into or out of water
-       if (gamemode != GAME_NEXUIZ && ((ent->fields.server->watertype == CONTENTS_WATER || ent->fields.server->watertype == CONTENTS_SLIME) != (cont == CONTENTS_WATER || cont == CONTENTS_SLIME)))
-               SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1);
+       if (sv_sound_watersplash.string && ((ent->fields.server->watertype == CONTENTS_WATER || ent->fields.server->watertype == CONTENTS_SLIME) != (cont == CONTENTS_WATER || cont == CONTENTS_SLIME)))
+               SV_StartSound (ent, 0, sv_sound_watersplash.string, 255, 1);
 
        if (cont <= CONTENTS_WATER)
        {
@@ -1381,8 +1387,8 @@ void SV_Physics_Step (prvm_edict_t *ent)
                        SV_LinkEdict(ent, true);
 
                        // just hit ground
-                       if (hitsound && (int)ent->fields.server->flags & FL_ONGROUND && gamemode != GAME_NEXUIZ)
-                               SV_StartSound(ent, 0, "demon/dland2.wav", 255, 1);
+                       if (hitsound && (int)ent->fields.server->flags & FL_ONGROUND && sv_sound_land.string)
+                               SV_StartSound(ent, 0, sv_sound_land.string, 255, 1);
                }
        }