Gunman Chronicles: Unstuck secondary option menus.

This commit is contained in:
Marco Cawthorne 2020-05-03 05:39:34 +02:00
parent fc3f124d24
commit 2db9d5bf31
6 changed files with 28 additions and 37 deletions

View file

@ -44,8 +44,6 @@ w_beamgun_release(void)
{
player pl = (player)self;
pl.flags |= FL_SEMI_TOGGLED;
if (pl.w_idle_next) {
return;
}
@ -60,13 +58,13 @@ w_beamgun_primary(void)
vector src;
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
if (pl.a_ammo1 > 0) {
pl.a_ammo1 = 0;
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
Weapons_ViewAnimation(BEAMGUN_CONFIG);
pl.w_attack_next = 2.26087f;
pl.w_idle_next = 2.26087f;
@ -92,11 +90,11 @@ w_beamgun_secondary(void)
{
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
if (pl.w_attack_next) {
return;

View file

@ -43,13 +43,13 @@ w_chemicalgun_primary(void)
vector src;
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
if (pl.a_ammo1 > 0) {
pl.a_ammo1 = 0;
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
Weapons_ViewAnimation(CHEMGUN_CONFIG);
pl.w_attack_next = 2.08f;
pl.w_idle_next = pl.w_attack_next;
@ -75,11 +75,11 @@ w_chemicalgun_secondary(void)
{
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
if (pl.w_attack_next) {
return;
@ -98,8 +98,6 @@ w_chemicalgun_release(void)
{
player pl = (player)self;
pl.flags |= FL_SEMI_TOGGLED;
if (pl.w_idle_next) {
return;
}

View file

@ -90,7 +90,7 @@ void
w_dml_release(void)
{
player pl = (player)self;
pl.flags |= FL_SEMI_TOGGLED;
if (pl.w_idle_next) {
return;
}
@ -131,13 +131,13 @@ w_dml_primary(void)
vector src;
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
if (pl.a_ammo1 > 0) {
pl.a_ammo1 = 0;
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
Weapons_ViewAnimation(DML_CUSTOMIZE);
#ifdef SERVER
Sound_Play(pl, 8, "weapon_dml.customize");
@ -173,11 +173,11 @@ w_dml_secondary(void)
{
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
if (pl.w_attack_next) {
return;

View file

@ -58,8 +58,6 @@ w_gausspistol_release(void)
{
player pl = (player)self;
pl.flags |= FL_SEMI_TOGGLED;
if (pl.w_idle_next) {
return;
}
@ -86,13 +84,13 @@ w_gausspistol_primary(void)
int take = 1;
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
if (pl.a_ammo1 > 0) {
pl.a_ammo1 = 0;
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
return;
}
@ -129,7 +127,7 @@ w_gausspistol_primary(void)
pl.w_idle_next = 5.0f;
break;
default:
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
Weapons_ViewAnimation(GP_FIRESINGLE);
#ifdef SERVER
Sound_Play(pl, CHAN_WEAPON, "weapon_gausspistol.firesingle");
@ -155,11 +153,11 @@ w_gausspistol_secondary(void)
{
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
/* activate menu */
pl.a_ammo1 = 1;

View file

@ -45,13 +45,13 @@ w_grenade_primary(void)
vector src;
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
if (pl.a_ammo1 > 0) {
pl.a_ammo1 = 0;
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
Weapons_ViewAnimation(GREN_FIDGET);
pl.w_attack_next = 1.2f;
pl.w_idle_next = pl.w_attack_next;
@ -77,11 +77,11 @@ w_grenade_secondary(void)
{
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
if (pl.w_attack_next) {
return;
@ -104,8 +104,6 @@ w_grenade_release(void)
{
player pl = (player)self;
pl.flags |= FL_SEMI_TOGGLED;
if (pl.w_idle_next) {
return;
}

View file

@ -68,13 +68,13 @@ w_shotgun_primary(void)
vector src;
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
if (pl.a_ammo1 > 0) {
pl.a_ammo1 = 0;
pl.flags &= ~FL_SEMI_TOGGLED;
pl.flags |= FL_SEMI_TOGGLED;
Weapons_ViewAnimation(SHOTGUN_CUSTOMIZE);
pl.w_attack_next = 2.25f;
pl.w_idle_next = 2.25f;
@ -137,13 +137,11 @@ w_shotgun_secondary(void)
{
player pl = (player)self;
if not (pl.flags & FL_SEMI_TOGGLED) {
if (pl.w_attack_next) {
return;
}
pl.flags &= ~FL_SEMI_TOGGLED;
if (pl.w_attack_next) {
if (pl.flags & FL_SEMI_TOGGLED) {
return;
}
@ -157,13 +155,14 @@ w_shotgun_secondary(void)
pl.a_ammo1 = 1;
}
}
pl.flags |= FL_SEMI_TOGGLED;
}
void
w_shotgun_release(void)
{
player pl = (player)self;
pl.flags |= FL_SEMI_TOGGLED;
if (pl.w_idle_next) {
return;