X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fnew_toys%2Fsv_new_toys.qc;h=47e1c97a9a9a70f1df5a7214ac56e12e8080bbed;hb=25c0e0a4d5c4d517947c5f8e390cc67a7aa30894;hp=288c2d5c8363ea473d824edf867275700221b677;hpb=5149aaa004721dba4947df89026a1c4b59506122;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc b/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc index 288c2d5c8..47e1c97a9 100644 --- a/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc +++ b/qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc @@ -1,5 +1,7 @@ #include "sv_new_toys.qh" +#include "../random_items/sv_random_items.qh" + /* CORE laser vortex lg rl cry gl elec hagar fireb hook @@ -26,7 +28,7 @@ Entity: -> This will spawn as Rifle in this mutator ONLY, and as Vortex otherwise. { -"classname" "weapon_vortext" +"classname" "weapon_vortex" "new_toys" "vortex rifle" } -> This will spawn as either Vortex or Rifle in this mutator ONLY, and as Vortex otherwise. @@ -68,9 +70,11 @@ roflsound "New toys, new toys!" sound. */ +//string autocvar_g_new_toys; + bool nt_IsNewToy(int w); -REGISTER_MUTATOR(nt, cvar("g_new_toys") && !cvar("g_instagib") && !cvar("g_overkill")) +REGISTER_MUTATOR(nt, expr_evaluate(cvar_string("g_new_toys")) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok)) { MUTATOR_ONADD { @@ -104,7 +108,7 @@ REGISTER_MUTATOR(nt, cvar("g_new_toys") && !cvar("g_instagib") && !cvar("g_overk .string new_toys; float autocvar_g_new_toys_autoreplace; -bool autocvar_g_new_toys_use_pickupsound = true; +bool autocvar_g_new_toys_use_pickupsound = false; const float NT_AUTOREPLACE_NEVER = 0; const float NT_AUTOREPLACE_ALWAYS = 1; const float NT_AUTOREPLACE_RANDOM = 2; @@ -191,6 +195,11 @@ MUTATOR_HOOKFUNCTION(nt, SetStartItems) MUTATOR_HOOKFUNCTION(nt, SetWeaponreplace) { + if (MUTATOR_IS_ENABLED(random_items)) + { + // Do not replace weapons when random items are enabled. + return; + } entity wep = M_ARGV(0, entity); entity wepinfo = M_ARGV(1, entity); string ret_string = M_ARGV(2, string);