]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Clean up weapon code
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
index 2a31be2a05c3b61fbb85b081bd0dd9052df43878..4cabc469798f1b74c095b94b1c94df35fe7c5414 100644 (file)
@@ -775,14 +775,15 @@ void PutPlayerInServer(entity this)
        for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
        {
                .entity weaponentity = weaponentities[slot];
+               entity w_ent = this.(weaponentity);
                if(slot == 0 || autocvar_g_weaponswitch_debug == 1)
-                       this.(weaponentity).m_switchweapon = w_getbestweapon(this, weaponentity);
+                       w_ent.m_switchweapon = w_getbestweapon(this, weaponentity);
                else
-                       this.(weaponentity).m_switchweapon = WEP_Null;
-               this.(weaponentity).m_weapon = WEP_Null;
-               this.(weaponentity).weaponname = "";
-               this.(weaponentity).m_switchingweapon = WEP_Null;
-               this.(weaponentity).cnt = -1;
+                       w_ent.m_switchweapon = WEP_Null;
+               w_ent.m_weapon = WEP_Null;
+               w_ent.weaponname = "";
+               w_ent.m_switchingweapon = WEP_Null;
+               w_ent.cnt = -1;
        }
 
        MUTATOR_CALLHOOK(PlayerWeaponSelect, this);