From 247d4789906878e719a3167fb7ab080481814a67 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 13 Jun 2018 17:51:35 -0400 Subject: [PATCH] Rename MAXACTIVETASKS to MAXACTIVEQUESTS --- zone/tasks.cpp | 64 +++++++++++++++++++++++++------------------------- zone/tasks.h | 8 +++---- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index ffff61bd6..b0efc0cb0 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -292,7 +292,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { Log(Logs::Detail, Logs::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); if(state->ActiveTaskCount > 0) { - for(int task=0; taskActiveTasks[task].TaskID; if(taskID==TASKSLOTEMPTY) continue; @@ -464,7 +464,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { continue; } - if((slot<0) || (slot>=MAXACTIVETASKS)) { + if((slot<0) || (slot>=MAXACTIVEQUESTS)) { Log(Logs::General, Logs::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); continue; } @@ -518,7 +518,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { // Find Active Task Slot int activeTaskIndex = -1; - for(int i=0; iActiveTasks[i].TaskID == taskID) { activeTaskIndex = i; break; @@ -632,7 +632,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { // Check that there is an entry in the client task state for every activity in each task // This should only break if a ServerOP adds or deletes activites for a task that players already // have active, or due to a bug. - for(int i=0; iActiveTasks[i].TaskID; if(taskID==TASKSLOTEMPTY) continue; if(!Tasks[taskID]) { @@ -659,7 +659,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { } } - for(int i=0; iActiveTasks[i].TaskID != TASKSLOTEMPTY) state->UnlockActivities(characterID, i); @@ -1281,7 +1281,7 @@ ClientTaskState::ClientTaskState() { LastCompletedTaskLoaded = 0; CheckedTouchActivities = false; - for(int i=0; i=MAXACTIVETASKS)) return 0; + if((index<0) || (index>=MAXACTIVEQUESTS)) return 0; return ActiveTasks[index].TaskID; } @@ -1485,7 +1485,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI if(!taskmanager || ActiveTaskCount == 0) return false; - for(int i=0; iTasks[ActiveTasks[i].TaskID]; @@ -1569,7 +1569,7 @@ int ClientTaskState::ActiveSpeakActivity(int NPCTypeID, int TaskID) { if(!taskmanager || ActiveTaskCount == 0) return -1; if((TaskID<=0) || (TaskID>=MAXTASKS)) return -1; - for(int i=0; iTasks[ActiveTasks[i].TaskID]; @@ -1605,7 +1605,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI if(ActiveTaskCount == 0) return; - for(int i=0; iSendTaskFailed(ActiveTasks[i].TaskID, i); @@ -2038,7 +2038,7 @@ bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) { int ActiveTaskIndex = -1; - for(int i=0; iMessage(0, "Task Information:"); //for(int i=0; i=MAXACTIVETASKS)) return false; + if((Index < 0) || (Index>=MAXACTIVEQUESTS)) return false; if((ActiveTasks[Index].TaskID <= 0) || (ActiveTasks[Index].TaskID >= MAXTASKS)) return false; @@ -2237,7 +2237,7 @@ void ClientTaskState::TaskPeriodicChecks(Client *c) { // Check for tasks that have failed because they have not been completed in the specified time // - for(int i=0; iGetActiveTaskCount(); TaskIndex++) { - for(int TaskIndex=0; TaskIndexGetActiveTaskID(TaskIndex); if((TaskID==0) || (Tasks[TaskID] ==0)) continue; int StartTime = c->GetTaskStartTime(TaskIndex); @@ -2730,7 +2730,7 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool TaskComplete, bool BringUpTaskJournal) { - if((TaskIndex < 0) || (TaskIndex >= MAXACTIVETASKS)) return; + if((TaskIndex < 0) || (TaskIndex >= MAXACTIVEQUESTS)) return; int TaskID = c->GetActiveTaskID(TaskIndex); @@ -2893,7 +2893,7 @@ int ClientTaskState::GetTaskActivityDoneCount(int index, int ActivityID) { int ClientTaskState::GetTaskActivityDoneCountFromTaskID(int TaskID, int ActivityID){ int ActiveTaskIndex = -1; - for(int i=0; iMessage(13, "You already have the maximum allowable number of active tasks (%i)", MAXACTIVETASKS); + if(ActiveTaskCount==MAXACTIVEQUESTS) { + c->Message(13, "You already have the maximum allowable number of active tasks (%i)", MAXACTIVEQUESTS); return; } - for(int i=0; iMessage(13, "You have already been assigned this task."); return; @@ -3014,7 +3014,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor // waste of bandwidth. // int FreeSlot = -1; - for(int i=0; iMessage(13, "You already have the maximum allowable number of active tasks (%i)", MAXACTIVETASKS); + c->Message(13, "You already have the maximum allowable number of active tasks (%i)", MAXACTIVEQUESTS); return; } diff --git a/zone/tasks.h b/zone/tasks.h index f1f160b56..ed6c01bff 100644 --- a/zone/tasks.h +++ b/zone/tasks.h @@ -28,8 +28,8 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) #define MAXTASKS 10000 #define MAXTASKSETS 1000 -// The Client has a hard cap of 19 active tasks -#define MAXACTIVETASKS 19 +// The Client has a hard cap of 19 active tasks, 29 in RoF2 +#define MAXACTIVEQUESTS 19 // The Max Chooser (Task Selector entries) is capped at 40 in the Titanium Client. #define MAXCHOOSERENTRIES 40 // The Client has a hard cap of 20 activities per task. @@ -228,8 +228,8 @@ private: bool UnlockActivities(int CharID, int TaskIndex); void IncrementDoneCount(Client *c, TaskInformation *Task, int TaskIndex, int ActivityID, int Count = 1, bool ignore_quest_update = false); int ActiveTaskCount; - ClientTaskInformation ActiveTasks[MAXACTIVETASKS]; - std::vectorEnabledTasks; + ClientTaskInformation ActiveTasks[MAXACTIVEQUESTS]; + std::vector EnabledTasks; std::vector CompletedTasks; int LastCompletedTaskLoaded; bool CheckedTouchActivities;