mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-02 19:30:25 +00:00
[Tasks] Extend IsTaskCompleted to also be aware of shared task completion (#4714)
* [Tasks] Extend IsTaskCompleted to also be aware of shared task completion * Fix my stupidity * Update client.h
This commit is contained in:
@@ -952,6 +952,8 @@ int ClientTaskState::IncrementDoneCount(
|
||||
|
||||
client->CancelTask(task_index, task_data->type);
|
||||
}
|
||||
|
||||
client->LoadClientSharedCompletedTasks();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1561,7 +1563,7 @@ int ClientTaskState::TaskTimeLeft(int task_id)
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool ClientTaskState::IsTaskCompleted(int task_id)
|
||||
bool ClientTaskState::IsTaskCompleted(int task_id, Client *c)
|
||||
{
|
||||
if (!RuleB(TaskSystem, RecordCompletedTasks)) {
|
||||
return false;
|
||||
@@ -1574,6 +1576,14 @@ bool ClientTaskState::IsTaskCompleted(int task_id)
|
||||
}
|
||||
}
|
||||
|
||||
if (c) {
|
||||
for (auto &e: c->GetCompletedSharedTasks()) {
|
||||
if (e == task_id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user