W_DecreaseAmmo(WEP_HMG, actor, WEP_CVAR_PRI(hmg, ammo), weaponentity);
- W_SetupShot (actor, weaponentity, true, 0, SND_UZI_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hmg, damage));
+ W_SetupShot(actor, weaponentity, true, 0, SND_UZI_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hmg, damage), WEP_HMG.m_id);
if(!autocvar_g_norecoil)
{
{
// Secondary uses it's own refire timer if refire_type is 1.
actor.jump_interval = time + WEP_CVAR_SEC(hmg, refire) * W_WeaponRateFactor(actor);
- // Ugly hack to reuse the fire mode of the blaster.
- makevectors(actor.v_angle);
- Weapon oldwep = actor.(weaponentity).m_weapon; // we can't avoid this hack
- actor.(weaponentity).m_weapon = WEP_BLASTER;
- W_Blaster_Attack(
- actor,
- weaponentity,
- WEP_BLASTER.m_id | HITTYPE_SECONDARY,
- WEP_CVAR_SEC(hmg, shotangle),
- WEP_CVAR_SEC(hmg, damage),
- WEP_CVAR_SEC(hmg, edgedamage),
- WEP_CVAR_SEC(hmg, radius),
- WEP_CVAR_SEC(hmg, force),
- WEP_CVAR_SEC(hmg, speed),
- WEP_CVAR_SEC(hmg, spread),
- WEP_CVAR_SEC(hmg, delay),
- WEP_CVAR_SEC(hmg, lifetime)
- );
- actor.(weaponentity).m_weapon = oldwep;
+ BLASTER_SECONDARY_ATTACK(hmg, actor, weaponentity);
if ((actor.(weaponentity).wframe == WFRAME_IDLE) ||
(actor.(weaponentity).wframe == WFRAME_FIRE2))
{
{
return;
}
- // ugly instagib hack to reuse the fire mode of the laser
- makevectors(actor.v_angle);
- Weapon oldwep = actor.(weaponentity).m_weapon; // we can't avoid this hack
- actor.(weaponentity).m_weapon = WEP_BLASTER;
- W_Blaster_Attack(
- actor,
- weaponentity,
- WEP_BLASTER.m_id | HITTYPE_SECONDARY,
- WEP_CVAR_SEC(hmg, shotangle),
- WEP_CVAR_SEC(hmg, damage),
- WEP_CVAR_SEC(hmg, edgedamage),
- WEP_CVAR_SEC(hmg, radius),
- WEP_CVAR_SEC(hmg, force),
- WEP_CVAR_SEC(hmg, speed),
- WEP_CVAR_SEC(hmg, spread),
- WEP_CVAR_SEC(hmg, delay),
- WEP_CVAR_SEC(hmg, lifetime)
- );
- actor.(weaponentity).m_weapon = oldwep;
+ BLASTER_SECONDARY_ATTACK(hmg, actor, weaponentity);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(hmg, animtime), w_ready);
}
}