]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Weapons: pass weaponentity field instead of slot
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index 7a18231392b3216e6a596fe71b48048d012c3b60..e8c5d2cd3a5229fe2d45d6131f24c0d6df8cbf39 100644 (file)
@@ -306,7 +306,7 @@ void PutObserverInServer()
        self.weaponmodel = "";
        for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
        {
-               self.weaponentity[slot] = NULL;
+               self.weaponentities[slot] = NULL;
        }
        self.exteriorweaponentity = world;
        self.killcount = FRAGS_SPECTATOR;
@@ -573,7 +573,7 @@ void PutClientInServer()
 
                for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
-                       CL_SpawnWeaponentity(this, slot);
+                       CL_SpawnWeaponentity(this, weaponentities[slot]);
                }
                this.alpha = default_player_alpha;
                this.colormod = '1 1 1' * autocvar_g_player_brightness;
@@ -2435,8 +2435,8 @@ void PlayerPreThink (void)
 
                // WEAPONTODO: THIS SHIT NEEDS TO GO EVENTUALLY
                // It cannot be predicted by the engine!
-               int slot = 0; // TODO: unhardcode
-               if((self.weapon == WEP_SHOCKWAVE.m_id || self.weapon == WEP_SHOTGUN.m_id) && self.weaponentity[slot].wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
+               .entity weaponentity = weaponentities[0]; // TODO: unhardcode
+               if((self.weapon == WEP_SHOCKWAVE.m_id || self.weapon == WEP_SHOTGUN.m_id) && self.(weaponentity).wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
                        do_crouch = 0;
 
                if (do_crouch)