]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/devastator.qc
Use the weapon entity as a parameter to ATTACK_FINISHED instead of the slot number...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / devastator.qc
index 1357fc5f2dbf8b4f028ca8161316149a92515f00..f8539b14c36b7eeb800830de893c625581e06337 100644 (file)
@@ -50,8 +50,7 @@ void W_Devastator_Explode(entity this, entity directhitentity)
                if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                        this.realowner.cnt = thiswep.m_id;
-                       int slot = weaponslot(weaponentity);
-                       ATTACK_FINISHED(this.realowner, slot) = time;
+                       ATTACK_FINISHED(this.realowner, weaponentity) = time;
                        this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
                }
        }
@@ -144,8 +143,7 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity)
                if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                        this.realowner.cnt = thiswep.m_id;
-                       int slot = weaponslot(weaponentity);
-                       ATTACK_FINISHED(this.realowner, slot) = time;
+                       ATTACK_FINISHED(this.realowner, weaponentity) = time;
                        this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
                }
        }
@@ -488,7 +486,7 @@ METHOD(Devastator, wr_checkammo1, bool(entity thiswep, entity actor, .entity wea
 {
     #if 0
     // don't switch while guiding a missile
-    if(ATTACK_FINISHED(actor, slot) <= time || PS(actor).m_weapon != WEP_DEVASTATOR)
+    if(ATTACK_FINISHED(actor, weaponentity) <= time || PS(actor).m_weapon != WEP_DEVASTATOR)
     {
         ammo_amount = false;
         if(WEP_CVAR(devastator, reload_ammo))