Resolve incorrectly marked consumables being unusable (#770)

A change was made in the mounts pull request that broke consumables without correctly marked types such as the picnic basket
This commit is contained in:
Jett 2022-09-05 23:28:32 +01:00 committed by GitHub
parent c552f46780
commit ce2e6f595b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,9 +272,12 @@ void Item::UseNonEquip() {
if (databasePet.lot != LOT_NULL) {
GetInventory()->GetComponent()->SpawnPet(this);
}
} else if (type == eItemType::ITEM_TYPE_PACKAGE) {
} else {
auto* compRegistryTable = CDClientManager::Instance()->GetTable<CDComponentsRegistryTable>("ComponentsRegistry");
const auto packageComponentId = compRegistryTable->GetByIDAndType(lot, COMPONENT_TYPE_PACKAGE);
if (packageComponentId == 0) return;
auto* packCompTable = CDClientManager::Instance()->GetTable<CDPackageComponentTable>("PackageComponent");
auto packages = packCompTable->Query([=](const CDPackageComponent entry) {return entry.id == static_cast<uint32_t>(packageComponentId); });