[Tasks] Zone Version Matching (#2303)

This commit is contained in:
Chris Miles
2022-07-14 02:57:23 -05:00
committed by GitHub
parent ddb5794462
commit ffe4d528e7
7 changed files with 33 additions and 17 deletions
+9 -9
View File
@@ -621,7 +621,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *client, TaskActivityType activity
continue;
}
// Is there a zone restriction on the activity_information ?
if (!activity_info->CheckZone(zone->GetZoneID())) {
if (!activity_info->CheckZone(zone->GetZoneID(), zone->GetInstanceVersion())) {
LogTasks(
"[UPDATE] character [{}] task_id [{}] activity_id [{}] activity_type [{}] for NPC [{}] failed zone check",
client->GetName(),
@@ -699,7 +699,7 @@ int ClientTaskState::ActiveSpeakTask(int npc_type_id)
continue;
}
// Is there a zone restriction on the activity_information ?
if (!activity_info->CheckZone(zone->GetZoneID())) {
if (!activity_info->CheckZone(zone->GetZoneID(), zone->GetInstanceVersion())) {
continue;
}
// Is the activity_information to speak with this type of NPC ?
@@ -748,7 +748,7 @@ int ClientTaskState::ActiveSpeakActivity(int npc_type_id, int task_id)
continue;
}
// Is there a zone restriction on the activity_information ?
if (!activity_info->CheckZone(zone->GetZoneID())) {
if (!activity_info->CheckZone(zone->GetZoneID(), zone->GetInstanceVersion())) {
continue;
}
@@ -809,7 +809,7 @@ void ClientTaskState::UpdateTasksForItem(Client *client, TaskActivityType activi
continue;
}
// Is there a zone restriction on the activity_information ?
if (!activity_info->CheckZone(zone->GetZoneID())) {
if (!activity_info->CheckZone(zone->GetZoneID(), zone->GetInstanceVersion())) {
LogTasks(
"[UpdateTasksForItem] Error: Character [{}] activity_information type [{}] for Item [{}] failed zone check",
client->GetName(),
@@ -881,7 +881,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *client, int explore_id)
if (activity_info->activity_type != TaskActivityType::Explore) {
continue;
}
if (!activity_info->CheckZone(zone->GetZoneID())) {
if (!activity_info->CheckZone(zone->GetZoneID(), zone->GetInstanceVersion())) {
LogTasks(
"[UpdateTasksOnExplore] character [{}] explore_id [{}] failed zone check",
client->GetName(),
@@ -977,7 +977,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(
continue;
}
// Is there a zone restriction on the activity_information ?
if (!activity_info->CheckZone(zone->GetZoneID())) {
if (!activity_info->CheckZone(zone->GetZoneID(), zone->GetInstanceVersion())) {
Log(
Logs::General, Logs::Tasks,
"[UPDATE] Char: %s Deliver activity_information failed zone check (current zone %i, need zone "
@@ -1039,7 +1039,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(
return is_updated;
}
void ClientTaskState::UpdateTasksOnTouch(Client *client, int zone_id)
void ClientTaskState::UpdateTasksOnTouch(Client *client, int zone_id, uint16 version)
{
// If the client has no tasks, there is nothing further to check.
@@ -1077,7 +1077,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *client, int zone_id)
if (activity_info->goal_method != METHODSINGLEID) {
continue;
}
if (!activity_info->CheckZone(zone_id)) {
if (!activity_info->CheckZone(zone_id, version)) {
LogTasks(
"[UpdateTasksOnTouch] character [{}] Touch activity_information failed zone check",
client->GetName()
@@ -1929,7 +1929,7 @@ void ClientTaskState::TaskPeriodicChecks(Client *client)
// the zone before we send the 'Task activity_information Completed' message.
//
if (!m_checked_touch_activities) {
UpdateTasksOnTouch(client, zone->GetZoneID());
UpdateTasksOnTouch(client, zone->GetZoneID(), zone->GetInstanceVersion());
m_checked_touch_activities = true;
}
}
+1 -1
View File
@@ -38,7 +38,7 @@ public:
void UpdateTasksOnExplore(Client *client, int explore_id);
bool UpdateTasksOnSpeakWith(Client *client, int npc_type_id);
bool UpdateTasksOnDeliver(Client *client, std::list<EQ::ItemInstance *> &items, int cash, int npc_type_id);
void UpdateTasksOnTouch(Client *client, int zone_id);
void UpdateTasksOnTouch(Client *client, int zone_id, uint16 version);
void ProcessTaskProximities(Client *client, float x, float y, float z);
bool TaskOutOfTime(TaskType task_type, int index);
void TaskPeriodicChecks(Client *client);
+2 -1
View File
@@ -236,6 +236,7 @@ bool TaskManager::LoadTasks(int single_task)
activity_data->goal_match_list = task_activity.goal_match_list;
activity_data->goal_count = task_activity.goalcount;
activity_data->deliver_to_npc = task_activity.delivertonpc;
activity_data->zone_version = task_activity.zone_version;
// zones
activity_data->zones = task_activity.zones;
@@ -1853,7 +1854,7 @@ void TaskManager::HandleUpdateTasksOnKill(Client *client, uint32 npc_type_id, st
}
// Is there a zone restriction on the activity_information ?
if (!activity_info->CheckZone(zone->GetZoneID())) {
if (!activity_info->CheckZone(zone->GetZoneID(), zone->GetInstanceVersion())) {
LogTasks(
"[HandleUpdateTasksOnKill] character [{}] task_id [{}] activity_id [{}] activity_type [{}] for NPC [{}] failed zone check",
client->GetName(),