]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix dumpweapons including the special attacks
authorMario <mario@smbclan.net>
Fri, 12 Oct 2018 12:38:43 +0000 (22:38 +1000)
committerMario <mario@smbclan.net>
Fri, 12 Oct 2018 12:38:43 +0000 (22:38 +1000)
qcsrc/common/weapons/config.qc

index d2443f1670d360767cbc6721f6a2722d2764997c..b53e25fde9c95cbdaddc1b987fd30fa16f8f8d16 100644 (file)
@@ -25,7 +25,10 @@ float W_Config_Queue_Compare(int root, int child, entity pass)
 void Dump_Weapon_Settings()
 {
        int totalweapons = 0, totalsettings = 0;
+       int wepcount = 1;
        FOREACH(Weapons, it != WEP_Null, {
+               if((it.spawnflags & WEP_FLAG_HIDDEN) && (it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && !(it.spawnflags & WEP_FLAG_NORMAL))
+                       continue; // never include the attacks
                // step 1: clear the queue
                WEP_CONFIG_COUNT = 0;
                for (int x = 0; x <= MAX_CONFIG_SETTINGS; ++x)
@@ -40,7 +43,7 @@ void Dump_Weapon_Settings()
                // step 4: write queue
                WEP_CONFIG_WRITETOFILE(sprintf(
                        "// {{{ #%d: %s%s\n",
-                       i,
+                       wepcount,
                        it.m_name,
                        ((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) ? " (MUTATOR WEAPON)" : "")
                ));
@@ -51,6 +54,7 @@ void Dump_Weapon_Settings()
                LOG_INFOF("#%d: %s: %d settings...", i, it.m_name, WEP_CONFIG_COUNT);
                totalweapons += 1;
                totalsettings += WEP_CONFIG_COUNT;
+               wepcount += 1;
        });
 
        // clear queue now that we're finished