- ATTACK_FINISHED(actor, slot) = ATTACK_FINISHED(actor, slot) + attacktime * W_WeaponRateFactor(actor);
+ float arate = W_WeaponRateFactor(actor);
+ ATTACK_FINISHED(actor, weaponentity) = ATTACK_FINISHED(actor, weaponentity) + attacktime * arate;
+
+ if(autocvar_g_weaponswitch_debug_alternate && W_DualWielding(actor))
+ {
+ int slot = weaponslot(weaponentity);
+ for(int wepslot = 0; wepslot < MAX_WEAPONSLOTS; ++wepslot)
+ {
+ if(slot == wepslot)
+ continue;
+ .entity wepent = weaponentities[wepslot];
+ if(actor.(wepent) && actor.(wepent).m_weapon != WEP_Null)
+ {
+ if(ATTACK_FINISHED(actor, wepent) > time + actor.(wepent).weapon_frametime * 0.5)
+ continue; // still cooling down!
+ if (ATTACK_FINISHED(actor, wepent) < time - actor.(wepent).weapon_frametime * 1.5)
+ ATTACK_FINISHED(actor, wepent) = time;
+ ATTACK_FINISHED(actor, wepent) = ATTACK_FINISHED(actor, wepent) + (attacktime * arate) / MAX_WEAPONSLOTS;
+ }
+ }
+ }