mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Move data aliases after null checks for safety [skip ci]
This commit is contained in:
parent
dcc921efcb
commit
ef0398ebd3
@ -154,10 +154,6 @@ bool TaskManager::LoadTasks(int single_task)
|
||||
int step = task_activity.step;
|
||||
int activity_id = task_activity.activityid;
|
||||
|
||||
// create pointer to activity data since declarations get unruly long
|
||||
int activity_index = m_task_data[task_id]->activity_count;
|
||||
ActivityInformation *activity_data = &m_task_data[task_id]->activity_information[activity_index];
|
||||
|
||||
if ((task_id <= 0) || (task_id >= MAXTASKS) || (activity_id < 0) || (activity_id >= MAXACTIVITIESPERTASK)) {
|
||||
|
||||
// This shouldn't happen, as the SELECT is bounded by MAXTASKS
|
||||
@ -178,6 +174,10 @@ bool TaskManager::LoadTasks(int single_task)
|
||||
continue;
|
||||
}
|
||||
|
||||
// create pointer to activity data since declarations get unruly long
|
||||
int activity_index = m_task_data[task_id]->activity_count;
|
||||
ActivityInformation *activity_data = &m_task_data[task_id]->activity_information[activity_index];
|
||||
|
||||
m_task_data[task_id]->activity_information[m_task_data[task_id]->activity_count].step_number = step;
|
||||
|
||||
if (step != 0) {
|
||||
@ -1653,4 +1653,4 @@ bool TaskManager::LoadClientState(Client *client, ClientTaskState *client_task_s
|
||||
LogTasks("[LoadClientState] for Character ID [{}] DONE!", character_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user