From e11610b9fad42ecfdc7b8cee6cabce5525dac77a Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Wed, 5 Apr 2023 11:20:13 -0400 Subject: [PATCH] [Cleanup] Remove unnecessary check for IsStackable() in DeleteItem() (#3186) # Notes - We check the opposites therefore we don't need either. - https://pvs-studio.com/en/docs/warnings/v728/ --- common/inventory_profile.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/inventory_profile.cpp b/common/inventory_profile.cpp index eb1926304..f9c173a66 100644 --- a/common/inventory_profile.cpp +++ b/common/inventory_profile.cpp @@ -412,11 +412,12 @@ bool EQ::InventoryProfile::DeleteItem(int16 slot_id, int16 quantity) { // If there are no charges left on the item, if (item_to_delete->GetCharges() <= 0) { // If the item is stackable (e.g arrows), or - // the item is not stackable, and is not a charged item, or is expendable, delete it - if (item_to_delete->IsStackable() || - (!item_to_delete->IsStackable() && - ((item_to_delete->GetItem()->MaxCharges == 0) || item_to_delete->IsExpendable())) - ) { + // the item is not a charged item, or is expendable, delete it + if ( + item_to_delete->IsStackable() || + item_to_delete->GetItem()->MaxCharges == 0 || + item_to_delete->IsExpendable() + ) { // Item can now be destroyed InventoryProfile::MarkDirty(item_to_delete); return true;