]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/selection.qc
Clean up weapon code
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / selection.qc
index 09f5e65ca14349aa7da3fc37f7d5b68638779647..ca331bb3c49af73091d4b0020f535d95e2bdc68b 100644 (file)
@@ -243,9 +243,10 @@ float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, fl
 void W_SwitchWeapon_Force(Player this, Weapon wep, .entity weaponentity)
 {
        TC(Weapon, wep);
-       this.(weaponentity).cnt = this.(weaponentity).m_switchweapon.m_id;
-       this.(weaponentity).m_switchweapon = wep;
-       this.(weaponentity).selectweapon = wep.m_id;
+       entity w_ent = this.(weaponentity);
+       w_ent.cnt = w_ent.m_switchweapon.m_id;
+       w_ent.m_switchweapon = wep;
+       w_ent.selectweapon = wep.m_id;
 }
 
 // perform weapon to attack (weaponstate and attack_finished check is here)