- use the correct code for the devastator in operateweapon.

The code present was from EDuke 2.1, I have no idea if it ever worked there. It was replaced with JFDuke's.
Fixes #104.
This commit is contained in:
Christoph Oelckers 2020-08-05 21:48:16 +02:00
parent 72806e27eb
commit ba3c353198

View file

@ -2370,23 +2370,30 @@ static void operateweapon(int snum, ESyncBits sb_snum, int psect)
{ {
p->kickback_pic++; p->kickback_pic++;
if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYOTHER) if (isNam())
// fire every other... {
if ((p->kickback_pic >= 2) &&
if ((p->kickback_pic >= aplWeaponFireDelay[p->curr_weapon][snum]) && p->kickback_pic < 5 &&
p->kickback_pic < aplWeaponHoldDelay[p->curr_weapon][snum] &&
(p->kickback_pic & 1)) (p->kickback_pic & 1))
{ {
{ p->visibility = 0;
// make them visible if not set... lastvisinc = (int)totalclock + 32;
p->visibility = 0;
lastvisinc = (int)totalclock + 32;
}
fi.shoot(pi, RPG); fi.shoot(pi, RPG);
p->ammo_amount[DEVISTATOR_WEAPON]--; p->ammo_amount[DEVISTATOR_WEAPON]--;
checkavailweapon(p); checkavailweapon(p);
} }
if (p->kickback_pic > 5) p->okickback_pic = p->kickback_pic = 0; if (p->kickback_pic > 5) p->kickback_pic = 0;
}
else if (p->kickback_pic & 1)
{
p->visibility = 0;
lastvisinc = (int)totalclock + 32;
fi.shoot(pi, RPG);
p->ammo_amount[DEVISTATOR_WEAPON]--;
checkavailweapon(p);
if (p->ammo_amount[DEVISTATOR_WEAPON] <= 0) p->kickback_pic = 0;
}
if (p->kickback_pic > 5) p->kickback_pic = 0;
} }
break; break;
case FREEZE_WEAPON: case FREEZE_WEAPON: