Skip to content

Commit

Permalink
[Tasks] Update tasks in all zones if invalid zone set (#4550)
Browse files Browse the repository at this point in the history
This allows task elements to update in any zone when it has an invalid
zone id <= 0. This has the same effect as leaving the zones field empty
except "Unknown Zone" instead of "ALL" will be shown in task windows.

Note that Titanium shows "ALL" for a zone id of 0 despite it being an
invalid zone id. This could be manipulated server side to match newer
clients but there isn't much benefit since any other invalid zone id
below 0 can be used to do the same.
  • Loading branch information
hgtw authored Nov 25, 2024
1 parent 6bd758b commit 187ee10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions common/tasks.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ struct ActivityInformation {
if (zone_ids.empty()) {
return true;
}
bool found_zone = std::find(zone_ids.begin(), zone_ids.end(), zone_id) != zone_ids.end();
bool found_zone = std::any_of(zone_ids.begin(), zone_ids.end(),
[zone_id](int id) { return id <= 0 || id == zone_id; });

return found_zone && (zone_version == version || zone_version == -1);
}
Expand All @@ -100,7 +101,7 @@ struct ActivityInformation {
out.WriteInt32(activity_type == TaskActivityType::GiveCash ? 1 : goal_count);
out.WriteLengthString(skill_list); // used in SkillOn objective type string, "-1" for none
out.WriteLengthString(spell_list); // used in CastOn objective type string, "0" for none
out.WriteString(zones); // used in objective zone column and task select "begins in" (may have multiple, "0" for "unknown zone", empty for "ALL")
out.WriteString(zones); // used in ui zone columns and task select "begins in" (may have multiple, invalid id for "Unknown Zone", empty for "ALL")
}
else
{
Expand All @@ -114,7 +115,7 @@ struct ActivityInformation {
out.WriteString(description_override);

if (client_version >= EQ::versions::ClientVersion::RoF) {
out.WriteString(zones); // serialized again after description (seems unused)
out.WriteString(zones); // target zone version internal id (unused client side)
}
}

Expand Down

0 comments on commit 187ee10

Please sign in to comment.