[Tasks] Change zone task data container (#2410)

This allows removal of the task id limit (MAXTASKS)

There's some suspect places task data isn't verified but left unchanged

If memory use becomes too high once more live data is added tasks can be
stored in shared memory instead
This commit is contained in:
hg
2022-09-03 04:33:49 -04:00
committed by GitHub
parent ec857cefae
commit efe1879115
7 changed files with 263 additions and 256 deletions
+3 -3
View File
@@ -35,8 +35,8 @@ void command_findtask(Client *c, const Seperator *sep)
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
if (!search_criteria.empty()) {
int found_count = 0;
for (uint32 task_id = 1; task_id <= MAXTASKS; task_id++) {
auto task_name = task_manager->GetTaskName(task_id);
for (const auto& task : task_manager->GetTaskData()) {
auto task_name = task.second.title;
std::string task_name_lower = Strings::ToLower(task_name);
if (task_name_lower.find(search_criteria) == std::string::npos) {
continue;
@@ -46,7 +46,7 @@ void command_findtask(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Task {}: {}",
task_id,
task.first,
task_name
).c_str()
);