diff --git a/changelog.txt b/changelog.txt index ad9699fb4..94ed3789f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,8 +5,8 @@ Uleat: Fix for unconscious skillups. Uleat: Fix for crash issue with nullptr reference in recent Client::SummonItem() work. Uleat: Added rule for GM Status check code in Client::SummonItem(). Note: Rule default is set to 250..but, implementation is on hold until load item code handles the database 'minstatus' field. - Uleat: Added RuleB(Bots, BotLevelsWithOwner). Bots will auto-update as their owner levels/de-levels. Appearance packets are sent to show the 'leveling effect' as well as updating client entities. +Trevius: Prevented an endless loop crash related to EVENT_TASK_STAGE_COMPLETE. Optional Bot SQL: utils/sql/git/bot/optional/2014_03_31_BotLevelsWithOwnerRule.sql Note: This sql is required to activate the optional behavior. diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 44d4e1e69..221085d4e 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -1972,14 +1972,6 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T Task->Activity[ActivityID].GoalCount, ActivityID); - if(Task->Activity[ActivityID].GoalMethod != METHODQUEST) - { - char buf[24]; - snprintf(buf, 23, "%d %d", ActiveTasks[TaskIndex].TaskID, ActiveTasks[TaskIndex].Activity[ActivityID].ActivityID); - buf[23] = '\0'; - parse->EventPlayer(EVENT_TASK_STAGE_COMPLETE, c, buf, 0); - } - // Flag the activity as complete ActiveTasks[TaskIndex].Activity[ActivityID].State = ActivityCompleted; // Unlock subsequent activities for this task @@ -1991,6 +1983,15 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T taskmanager->SendSingleActiveTaskToClient(c, TaskIndex, TaskComplete, false); // Inform the client the task has been updated, both by a chat message c->Message(0, "Your task '%s' has been updated.", Task->Title); + + if(Task->Activity[ActivityID].GoalMethod != METHODQUEST) + { + char buf[24]; + snprintf(buf, 23, "%d %d", ActiveTasks[TaskIndex].TaskID, ActiveTasks[TaskIndex].Activity[ActivityID].ActivityID); + buf[23] = '\0'; + parse->EventPlayer(EVENT_TASK_STAGE_COMPLETE, c, buf, 0); + } + // If this task is now complete, the Completed tasks will have been // updated in UnlockActivities. Send the completed task list to the // client. This is the same sequence the packets are sent on live.