- Duke: When using cl_showmagamt 1, increase pistol maximum by 4 so that when you have full ammunition, you have a full clip.

* On the fence about this. Lower makes the game harder, and higher could mean the difference between life and death. I do think that if we're showing amounts in the magazine, full ammo should constitute a full magazine. I think the max of 200 is an oversight from the original devs as all other games have proper defaults that reflect the magazine or cylinder capacity.
This commit is contained in:
Mitchell Richters 2020-08-28 09:57:40 +10:00 committed by Christoph Oelckers
parent 10962e2193
commit 1617938d4f
2 changed files with 22 additions and 0 deletions

View file

@ -409,6 +409,7 @@ enum miscConstants
MAXGEOSECTORS = 64,
CRACK_TIME = 777,
PISTOL_MAXDEFAULT = 200,
DUKE3D_NO_WIDESCREEN_PINNING = 1 << 0,
};

View file

@ -2521,6 +2521,27 @@ static void processweapon(int snum, ESyncBits sb_snum, int psect)
auto s = &sprite[pi];
int shrunk = (s->yrepeat < 32);
// Set maximum for pistol slightly higher if playing with `cl_showmagamount 1`.
if (!cl_showmagamt)
{
if (p->ammo_amount[PISTOL_WEAPON] > PISTOL_MAXDEFAULT)
p->ammo_amount[PISTOL_WEAPON] = PISTOL_MAXDEFAULT;
if (max_ammo_amount[PISTOL_WEAPON] != PISTOL_MAXDEFAULT)
max_ammo_amount[PISTOL_WEAPON] = PISTOL_MAXDEFAULT;
}
else
{
short pistolAddition = 4;
short pistolNewMaximum = PISTOL_MAXDEFAULT + pistolAddition;
if (p->ammo_amount[PISTOL_WEAPON] == PISTOL_MAXDEFAULT && max_ammo_amount[PISTOL_WEAPON] == PISTOL_MAXDEFAULT)
p->ammo_amount[PISTOL_WEAPON] += pistolAddition;
if (max_ammo_amount[PISTOL_WEAPON] != pistolNewMaximum)
max_ammo_amount[PISTOL_WEAPON] = pistolNewMaximum;
}
if (isNamWW2GI() && (sb_snum & SKB_HOLSTER)) // 'Holster Weapon
{
if (isWW2GI())