]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Disable new toys weapon replacement when random items are enabled.
authorLyberta <lyberta@lyberta.net>
Tue, 24 Oct 2017 21:27:32 +0000 (00:27 +0300)
committerLyberta <lyberta@lyberta.net>
Tue, 24 Oct 2017 21:27:32 +0000 (00:27 +0300)
qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc
qcsrc/common/mutators/mutator/random_items/sv_random_items.qc
qcsrc/common/mutators/mutator/random_items/sv_random_items.qh

index af364995a1e92bc13c42b287babb5e3471938441..ec2593215a09b5187abd522608e07dc6f978e141 100644 (file)
@@ -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
@@ -193,6 +195,11 @@ MUTATOR_HOOKFUNCTION(nt, SetStartItems)
 
 MUTATOR_HOOKFUNCTION(nt, SetWeaponreplace)
 {
+       if (autocvar_g_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);
index b0c49d64d959d82343167a77c5c2ec52a5c0197f..3330bfeddd8c02fee0210d99bbb8816a3378e646 100644 (file)
@@ -1,4 +1,5 @@
 #include "sv_random_items.qh"
+
 /// \file
 /// \brief Source file that contains implementation of the random items mutator.
 /// \author Lyberta
@@ -17,8 +18,6 @@ enum
 
 //======================= Global variables ====================================
 
-bool autocvar_g_random_items; ///< Whether to enable random items.
-
 // Replace cvars
 
 /// \brief Classnames to replace %s with.
index 6f70f09beec2219624baeca92e2cd7deaa104fb4..a0cc25baf0733707f651ed6bc335b9d02762e8fa 100644 (file)
@@ -1 +1,3 @@
 #pragma once
+
+bool autocvar_g_random_items; ///< Whether to enable random items.