[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/
This commit is contained in:
Alex King 2023-04-05 11:20:13 -04:00 committed by GitHub
parent 3e652b98bc
commit e11610b9fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -412,11 +412,12 @@ bool EQ::InventoryProfile::DeleteItem(int16 slot_id, int16 quantity) {
// If there are no charges left on the item, // If there are no charges left on the item,
if (item_to_delete->GetCharges() <= 0) { if (item_to_delete->GetCharges() <= 0) {
// If the item is stackable (e.g arrows), or // 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 // the item is not a charged item, or is expendable, delete it
if (item_to_delete->IsStackable() || if (
(!item_to_delete->IsStackable() && item_to_delete->IsStackable() ||
((item_to_delete->GetItem()->MaxCharges == 0) || item_to_delete->IsExpendable())) item_to_delete->GetItem()->MaxCharges == 0 ||
) { item_to_delete->IsExpendable()
) {
// Item can now be destroyed // Item can now be destroyed
InventoryProfile::MarkDirty(item_to_delete); InventoryProfile::MarkDirty(item_to_delete);
return true; return true;