[Bug Fix] NPC::CountItem and Corpse::CountItem 0 Charge Item Fix. (#1959)

- Fixes an issue where 0 charged or out of charge items do not count towards the return value.
This commit is contained in:
Kinglykrab 2022-02-04 06:07:46 -05:00 committed by GitHub
parent 5ce2889210
commit 0400504adc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1570,7 +1570,7 @@ uint16 Corpse::CountItem(uint32 item_id) {
}
if (loot_item->item_id == item_id) {
item_count += loot_item->charges;
item_count += loot_item->charges > 0 ? loot_item->charges : 1;
}
}
return item_count;

View File

@ -758,7 +758,7 @@ uint16 NPC::CountItem(uint32 item_id) {
}
if (loot_item->item_id == item_id) {
item_count += loot_item->charges;
item_count += loot_item->charges > 0 ? loot_item->charges : 1;
}
}
return item_count;