Allow refire of pulsegun and minigun during cooldown/unwind.

This commit is contained in:
Marisa the Magician 2018-06-09 14:49:55 +02:00
commit c1e21988bb
2 changed files with 36 additions and 9 deletions

View file

@ -497,17 +497,31 @@ Class PulseGun : UTWeapon
s.vel = pvel;
}
}
action void A_PulseRefire( statelabel flash = null )
action void A_PulseRefire( statelabel flash = null, bool noreload = false )
{
Weapon weap = Weapon(invoker);
if ( !weap || !player ) return;
if ( (invoker.clipcount <= 0) || (weap.Ammo1.Amount <= 0) )
{
if ( noreload ) return;
A_ClearRefire();
if ( weap.bAltFire ) player.setpsprite(PSP_WEAPON,weap.FindState("AltRelease"));
else player.setpsprite(PSP_WEAPON,weap.FindState("Release"));
return;
}
if ( noreload )
{
if ( player.cmd.buttons&BT_ALTATTACK )
{
weap.bAltFire = true;
flash = "AltFire";
}
else
{
weap.bAltFire = false;
flash = "Fire";
}
}
A_Refire(flash);
}
action void A_PulseFire()
@ -646,7 +660,7 @@ Class PulseGun : UTWeapon
Goto Release;
Release:
PGNC A 0 A_PlaySound("pulse/down",CHAN_WEAPON);
PGNC ABCDEFGHIJKLMNOPQRSTUVWXY 1;
PGNC ABCDEFGHIJKLMNOPQRSTUVWXY 1 A_PulseRefire(null,true);
PGNC Y 0;
Goto Idle;
AltFire:
@ -684,7 +698,7 @@ Class PulseGun : UTWeapon
PGBL A 0 A_PulseRefire();
AltRelease:
PGBE A 0 A_StopBeam();
PGBE ABCDE 1;
PGBE ABCDE 1 A_PulseRefire(null,true);
Goto Idle;
Reload:
PGNI A 1;