From dc60c643c98693d2a29cf6d2f04cd1bb18f15bd6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 26 Nov 2022 17:59:22 +0100 Subject: [PATCH] - Duke: added an ammo check to the chaingun firing loop With weapon switching disabled it would not stop firing. --- source/games/duke/src/player_d.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 95282c531..9dcd6e3e7 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -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)