From 941fa4dd77982d0ff7628f7bc83d704f209c78f0 Mon Sep 17 00:00:00 2001 From: Image <> Date: Sun, 28 Feb 2021 09:07:49 -0500 Subject: [PATCH] cleanup on QuestStep constructor --- EQ2/source/WorldServer/Quests.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/EQ2/source/WorldServer/Quests.cpp b/EQ2/source/WorldServer/Quests.cpp index 5270e5b6e..4ec70245b 100644 --- a/EQ2/source/WorldServer/Quests.cpp +++ b/EQ2/source/WorldServer/Quests.cpp @@ -37,28 +37,23 @@ extern MasterFactionList master_faction_list; QuestStep::QuestStep(int32 in_id, int8 in_type, string in_description, vector<int32>* in_ids, int32 in_quantity, const char* in_task_group, vector<Location>* in_locations, float in_max_variation, float in_percentage, int32 in_usableitemid){ type = in_type; description = in_description; - ids = in_ids; + ids = 0; + locations = 0; if(in_task_group) task_group = string(in_task_group); if(type != QUEST_STEP_TYPE_LOCATION) { - locations = 0; if (in_ids){ - in_ids = new vector<int32>; + ids = new vector<int32>; for(int32 i=0;i<in_ids->size();i++) ids->push_back(in_ids->at(i)); } - else - ids = 0; } else { // location step - ids = 0; if (in_locations) { locations = new vector<Location>; for(int32 i=0; i < in_locations->size(); i++) locations->push_back(in_locations->at(i)); } - else - locations = 0; } max_variation = in_max_variation; quantity = in_quantity; @@ -80,24 +75,18 @@ QuestStep::QuestStep(QuestStep* old_step){ ids = 0; locations = 0; if(type != QUEST_STEP_TYPE_LOCATION) { - locations = 0; if (old_step->ids){ ids = new vector<int32>; for(int32 i=0;i<old_step->ids->size();i++) ids->push_back(old_step->ids->at(i)); } - else - ids = 0; } else { // location step - ids = 0; if (old_step->locations) { locations = new vector<Location>; for(int32 i=0; i < old_step->locations->size(); i++) locations->push_back(old_step->locations->at(i)); } - else - locations = 0; } icon = old_step->icon; id = old_step->id;