- Duke: added an ammo check to the chaingun firing loop

With weapon switching disabled it would not stop firing.
This commit is contained in:
Christoph Oelckers 2022-11-26 17:59:22 +01:00
parent aa3df50f9b
commit dc60c643c9

View file

@ -2375,6 +2375,12 @@ static void operateweapon(int snum, ESyncBits actions)
{
if (((p->kickback_pic) % 3) == 0)
{
if (p->ammo_amount[CHAINGUN_WEAPON] <= 0)
{
p->ammo_amount[CHAINGUN_WEAPON] = 0;
p->okickback_pic = p->kickback_pic = 0;
break;
}
p->ammo_amount[CHAINGUN_WEAPON]--;
if ((p->kickback_pic % 3) == 0)