[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
@@ -162,7 +162,7 @@ void command_task(Client *c, const Seperator *sep)
if (is_assign) {
auto task_id = std::strtoul(sep->arg[2], nullptr, 10);
if (task_id && task_id < MAXTASKS) {
if (task_id) {
target->AssignTask(task_id, 0, false);
c->Message(
Chat::Yellow,
@@ -203,7 +203,7 @@ void command_task(Client *c, const Seperator *sep)
return;
} else if (!strcasecmp(sep->arg[2], "task") && arguments == 3) {
int task_id = std::strtoul(sep->arg[3], nullptr, 10);
if (task_id && task_id < MAXTASKS) {
if (task_id) {
c->Message(
Chat::Yellow,
fmt::format(
@@ -252,7 +252,7 @@ void command_task(Client *c, const Seperator *sep)
} else if (is_uncomplete) {
if (sep->IsNumber(2)) {
auto task_id = std::stoul(sep->arg[2]);
if (!task_id || task_id > MAXTASKS) {
if (!task_id) {
c->Message(Chat::White, "Invalid task ID specified.");
return;
}