]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/spawning.qc
Fix a minor typo in a comment
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / spawning.qc
index 810cc2638453561cbf11ab56f2ecfd591310db5c..0685062f58787167e8a463576ba98638becf72eb 100644 (file)
@@ -1,10 +1,10 @@
 #include "spawning.qh"
 
+#include <common/resources/sv_resources.qh>
 #include <common/weapons/_all.qh>
 #include <server/items/items.qh>
 #include <server/items/spawning.qh>
 #include <server/mutators/_mod.qh>
-#include <server/resources.qh>
 #include <server/weapons/weaponsystem.qh>
 #include <server/world.qh>
 
@@ -60,7 +60,9 @@ void weapon_defaultspawnfunc(entity this, Weapon wpn)
                                if(wep != WEP_Null)
                                {
                                        entity replacement = spawn();
-                                       copyentity(this, replacement);
+                                       Item_CopyFields(this, replacement);
+                                       // DO NOT USE, causes #2792
+                                       //copyentity(this, replacement);
                                        replacement.m_isreplaced = true;
                                        weapon_defaultspawnfunc(replacement, wep);
                                }
@@ -108,6 +110,7 @@ void weapon_defaultspawnfunc(entity this, Weapon wpn)
                        this.superweapons_finished = autocvar_g_balance_superweapons_time;
 
        // if we don't already have ammo, give us some ammo
+       // TODO: registry handles
        if ((wpn.ammo_type != RES_NONE) && !GetResource(this, wpn.ammo_type))
        {
                int ammo = 0;
@@ -151,6 +154,8 @@ void weapon_defaultspawnfunc(entity this, Weapon wpn)
 
        if(!this.owner)
                this.glowmod = wpn.wpcolor;
+       else
+               this.glowmod = colormapPaletteColor(this.owner.clientcolors & 0x0F, true);
 
        GameItem def = wpn.m_pickup;
        _StartItem(