From 17c4d27298f8a62029f3d87c70fd43ab9f833932 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sun, 15 Oct 2017 23:10:12 +0000 Subject: [PATCH] if (A ? 1 : B) --> if (A || B) git-svn-id: https://svn.eduke32.com/eduke32@6479 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/player.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index b53d4dd5b..6fe5c1aeb 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -4167,7 +4167,7 @@ static void P_ProcessWeapon(int playerNum) else { if (PWEAPON(playerNum, pPlayer->curr_weapon, Flags) & WEAPON_AUTOMATIC && - (PWEAPON(playerNum, pPlayer->curr_weapon, WorksLike)==KNEE_WEAPON?1:pPlayer->ammo_amount[pPlayer->curr_weapon] > 0)) + (PWEAPON(playerNum, pPlayer->curr_weapon, WorksLike)==KNEE_WEAPON || pPlayer->ammo_amount[pPlayer->curr_weapon] > 0)) { if (TEST_SYNC_KEY(playerBits, SK_FIRE)) { @@ -4180,15 +4180,14 @@ static void P_ProcessWeapon(int playerNum) if (PWEAPON(playerNum, pPlayer->curr_weapon, Flags) & WEAPON_RESET && ((PWEAPON(playerNum, pPlayer->curr_weapon, WorksLike) == KNEE_WEAPON) - ? 1 - : pPlayer->ammo_amount[pPlayer->curr_weapon] > 0)) + || pPlayer->ammo_amount[pPlayer->curr_weapon] > 0)) { *weaponFrame = !!(TEST_SYNC_KEY(playerBits, SK_FIRE)); } } } else if (*weaponFrame >= PWEAPON(playerNum, pPlayer->curr_weapon, FireDelay) && (*weaponFrame) < PWEAPON(playerNum, pPlayer->curr_weapon, TotalTime) - && ((PWEAPON(playerNum, pPlayer->curr_weapon, WorksLike) == KNEE_WEAPON)?1:pPlayer->ammo_amount[pPlayer->curr_weapon] > 0)) + && ((PWEAPON(playerNum, pPlayer->curr_weapon, WorksLike) == KNEE_WEAPON) || pPlayer->ammo_amount[pPlayer->curr_weapon] > 0)) { if (PWEAPON(playerNum, pPlayer->curr_weapon, Flags) & WEAPON_AUTOMATIC) {