mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 15:58:36 +00:00
[Tasks] Add pre-task update event (#2512)
This adds the player EVENT_TASK_BEFORE_UPDATE event which will allow quests to prevent a source controlled task update by returning non-zero.
This commit is contained in:
@@ -564,6 +564,15 @@ int ClientTaskState::UpdateTasks(Client* client, const TaskUpdateFilter& filter,
|
||||
|
||||
if (CanUpdate(client, filter, client_task.task_id, activity, client_activity))
|
||||
{
|
||||
auto args = fmt::format("{} {} {}", count, client_activity.activity_id, client_task.task_id);
|
||||
if (parse->EventPlayer(EVENT_TASK_BEFORE_UPDATE, client, args, 0) != 0)
|
||||
{
|
||||
LogTasks("[UpdateTasks] client [{}] task [{}]-[{}] update prevented by quest",
|
||||
client->GetName(), client_task.task_id, client_activity.activity_id);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
LogTasks("[UpdateTasks] client [{}] task [{}] activity [{}] increment [{}]",
|
||||
client->GetName(), client_task.task_id, client_activity.activity_id, count);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user