]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Random items: Better weapon replacement code.
authorLyberta <lyberta@lyberta.net>
Mon, 16 Oct 2017 10:05:40 +0000 (13:05 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 16 Oct 2017 10:05:40 +0000 (13:05 +0300)
qcsrc/common/mutators/mutator/random_items/sv_random_items.qc

index 2e976a8beb718a210076f92a29c15089f19e51cb..2df1fabfa7ed686251eb14faa82b4a14fca62175 100644 (file)
@@ -81,7 +81,7 @@ string RandomItems_GetItemVarName(string class_name)
 {
        if (startsWith(class_name, "weapon_"))
        {
-               FOREACH(Weapons, sprintf("weapon_%s", it.netname) == class_name, {
+               FOREACH(Weapons, it.m_canonical_spawnfunc == class_name, {
                        if (it.spawnflags & WEP_FLAG_MUTATORBLOCKED)
                        {
                                return "";