X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fmutator_new_toys.qc;h=9b51d9abb8640fbcaf4f3bbcf5ef83d5f652f760;hb=96e1acc3050bcb718e2f06702e5b88a60459a015;hp=d52bd09ee32c68ddd70a332ca62bd139f4b287c7;hpb=9eb82dd6fc682e3ddecd471835f9047816236342;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mutators/mutator_new_toys.qc b/qcsrc/server/mutators/mutator_new_toys.qc index d52bd09ee..9b51d9abb 100644 --- a/qcsrc/server/mutators/mutator_new_toys.qc +++ b/qcsrc/server/mutators/mutator_new_toys.qc @@ -73,6 +73,7 @@ roflsound "New toys, new toys!" sound. .string new_toys; float autocvar_g_new_toys_autoreplace; +bool autocvar_g_new_toys_use_pickupsound = true; const float NT_AUTOREPLACE_NEVER = 0; const float NT_AUTOREPLACE_ALWAYS = 1; const float NT_AUTOREPLACE_RANDOM = 2; @@ -87,11 +88,11 @@ float nt_IsNewToy(float w) { switch(w) { - case WEP_SEEKER: - case WEP_MINE_LAYER: - case WEP_HLAC: - case WEP_RIFLE: - case WEP_SHOCKWAVE: + case WEP_SEEKER.m_id: + case WEP_MINE_LAYER.m_id: + case WEP_HLAC.m_id: + case WEP_RIFLE.m_id: + case WEP_SHOCKWAVE.m_id: return true; default: return false; @@ -106,7 +107,7 @@ string nt_GetFullReplacement(string w) case "devastator": return "minelayer"; case "machinegun": return "hlac"; case "vortex": return "rifle"; - case "shotgun": return "shockwave"; + //case "shotgun": return "shockwave"; default: return string_null; } } @@ -168,7 +169,7 @@ MUTATOR_HOOKFUNCTION(nt_SetStartItems) } MUTATOR_HOOKFUNCTION(nt_SetWeaponreplace) -{ +{SELFPARAM(); // otherwise, we do replace if(self.new_toys) { @@ -188,9 +189,11 @@ MUTATOR_HOOKFUNCTION(nt_SetWeaponreplace) } MUTATOR_HOOKFUNCTION(nt_FilterItem) -{ - if(nt_IsNewToy(self.weapon)) - self.item_pickupsound = "weapons/weaponpickup_new_toys.wav"; +{SELFPARAM(); + if(nt_IsNewToy(self.weapon) && autocvar_g_new_toys_use_pickupsound) { + self.item_pickupsound = string_null; + self.item_pickupsound_ent = SND_WEAPONPICKUP_NEW_TOYS; + } return 0; } @@ -206,8 +209,6 @@ MUTATOR_DEFINITION(mutator_new_toys) if(time > 1) // game loads at time 1 error("This cannot be added at runtime\n"); - precache_sound("weapons/weaponpickup_new_toys.wav"); - // mark the guns as ok to use by e.g. impulse 99 float i; for(i = WEP_FIRST; i <= WEP_LAST; ++i) @@ -225,7 +226,7 @@ MUTATOR_DEFINITION(mutator_new_toys) MUTATOR_ONREMOVE { - print("This cannot be removed at runtime\n"); + LOG_INFO("This cannot be removed at runtime\n"); return -1; }