Fix Some missions not progressing if they are the last item in the inventory (#899)

This commit is contained in:
David Markowitz 2022-12-19 00:07:43 -08:00 committed by GitHub
parent 84c5d74450
commit f311685dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5736,16 +5736,16 @@ void GameMessages::HandleClientItemConsumed(RakNet::BitStream* inStream, Entity*
} }
auto* item = inventory->FindItemById(itemConsumed); auto* item = inventory->FindItemById(itemConsumed);
if (item == nullptr) { if (item == nullptr) {
return; return;
} }
LOT itemLot = item->GetLot();
item->Consume(); item->Consume();
auto* missions = static_cast<MissionComponent*>(entity->GetComponent(COMPONENT_TYPE_MISSION)); auto* missions = static_cast<MissionComponent*>(entity->GetComponent(COMPONENT_TYPE_MISSION));
if (missions != nullptr) { if (missions != nullptr) {
missions->Progress(MissionTaskType::MISSION_TASK_TYPE_FOOD, item->GetLot()); missions->Progress(MissionTaskType::MISSION_TASK_TYPE_FOOD, itemLot);
} }
} }