Fix Trigger Missions (#1010)

This commit is contained in:
David Markowitz 2023-03-03 22:58:29 -08:00 committed by GitHub
parent 3e482602d4
commit a0c0a87956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,19 +163,14 @@ void TriggerComponent::HandleSetPhysicsVolume(Entity* targetEntity, std::vector<
void TriggerComponent::HandleUpdateMission(Entity* targetEntity, std::vector<std::string> argArray) {
CDMissionTasksTable* missionTasksTable = CDClientManager::Instance()->GetTable<CDMissionTasksTable>("MissionTasks");
std::vector<CDMissionTasks> missionTasks = missionTasksTable->Query([=](CDMissionTasks entry) {
std::string lowerTargetGroup;
for (char character : entry.targetGroup) {
lowerTargetGroup.push_back(std::tolower(character)); // make lowercase to ensure it works
}
return (lowerTargetGroup == argArray[4]);
return (entry.targetGroup == argArray.at(4));
});
for (const CDMissionTasks& task : missionTasks) {
MissionComponent* missionComponent = targetEntity->GetComponent<MissionComponent>();
if (!missionComponent) continue;
missionComponent->ForceProgress(task.id, task.uid, std::stoi(argArray[2]));
missionComponent->ForceProgress(task.id, task.uid, std::stoi(argArray.at(2)));
}
}