From 7e527bdeb3d1ce2341ce7dd685b98bde8956772d Mon Sep 17 00:00:00 2001 From: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Tue, 14 Nov 2023 07:55:11 -0300 Subject: [PATCH] Fix a demo desync related to `switch_on_pickup` --- CHANGELOG.md | 1 + src/p_inter.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 962445e9b..363bde120 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,4 +24,5 @@ - **Disabled teleport-to-Automap-pointer during non-Casual Play** - **Excess speed when airborne with noclip enabled** [thanks @kitchen-ace] - **Teleporter Zoom affecting all players in multiplayer** +- **Fixed a demo desync** caused by a failed weapon autoswitch when picking up ammo - **Tweaked dark menu background and Automap overlay algorithm** (fixes very low values) diff --git a/src/p_inter.c b/src/p_inter.c index 42a73697c..3deb55dda 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -151,7 +151,7 @@ boolean P_GiveAmmo(player_t *player, ammotype_t ammo, int num) return P_GiveAmmoAutoSwitch(player, ammo, oldammo); // If non zero ammo, don't change up weapons, player was lower on purpose. - if (oldammo || P_AutoswitchWeapon()) // [Nugget] + if (oldammo || !P_AutoswitchWeapon()) // [Nugget] return true; // We were down to zero, so select a new weapon.