aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShinDarth <borzifrancesco@gmail.com>2015-12-07 14:09:40 +0100
committerMitchesD <majklprofik@seznam.cz>2016-01-16 13:05:59 +0100
commitcb29fa74d8c003bce14c1f1004459d0cf907dea9 (patch)
treed264f6ff69a904485207d550cae6f77403b6e32e /src
parent05f0badd40fe65599346e3629435db2bbc133ff8 (diff)
Core/Quest: code style:
- Removed 11 useless for iterations (for each quest loaded) (cherry picked from commit 4a532a71b655945f394fecfe4a2177b2618a6d59) # Conflicts: # src/server/game/Quests/QuestDef.cpp
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Quests/QuestDef.cpp39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index ef00c7c092b..91a928b7a98 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -23,6 +23,12 @@
Quest::Quest(Field* questRecord)
{
+ EmoteOnIncomplete = 0;
+ EmoteOnComplete = 0;
+ _rewItemsCount = 0;
+ _rewChoiceItemsCount = 0;
+ _rewCurrencyCount = 0;
+
ID = questRecord[0].GetUInt32();
Type = questRecord[1].GetUInt8();
Level = questRecord[2].GetInt32();
@@ -52,6 +58,9 @@ Quest::Quest(Field* questRecord)
RewardItemCount[i] = questRecord[23+i*4].GetUInt32();
ItemDrop[i] = questRecord[24+i*4].GetUInt32();
ItemDropQuantity[i] = questRecord[25+i*4].GetUInt32();
+
+ if (RewardItemId[i])
+ ++_rewItemsCount;
}
for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
@@ -59,6 +68,9 @@ Quest::Quest(Field* questRecord)
RewardChoiceItemId[i] = questRecord[38+i*3].GetUInt32();
RewardChoiceItemCount[i] = questRecord[39+i*3].GetUInt32();
RewardChoiceItemDisplayId[i] = questRecord[40+i*3].GetUInt32();
+
+ if (RewardChoiceItemId[i])
+ ++_rewChoiceItemsCount;
}
POIContinent = questRecord[56].GetUInt32();
@@ -88,6 +100,9 @@ Quest::Quest(Field* questRecord)
{
RewardCurrencyId[i] = questRecord[83+i*2].GetUInt32();
RewardCurrencyCount[i] = questRecord[84+i*2].GetUInt32();
+
+ if (RewardCurrencyId[i])
+ ++_rewCurrencyCount;
}
SoundAccept = questRecord[91].GetUInt32();
@@ -106,33 +121,13 @@ Quest::Quest(Field* questRecord)
PortraitTurnInName = questRecord[103].GetString();
QuestCompletionLog = questRecord[104].GetString();
- _rewItemsCount = 0;
- _rewChoiceItemsCount = 0;
- _rewCurrencyCount = 0;
-
- for (int i = 0; i < QUEST_REWARD_ITEM_COUNT; ++i)
- if (RewardItemId[i])
- ++_rewItemsCount;
-
- for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
- if (RewardChoiceItemId[i])
- ++_rewChoiceItemsCount;
-
- for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i)
- if (RewardCurrencyId[i])
- ++_rewCurrencyCount;
-
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
+ {
DetailsEmote[i] = 0;
-
- for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
DetailsEmoteDelay[i] = 0;
-
- for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmote[i] = 0;
-
- for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmoteDelay[i] = 0;
+ }
}
void Quest::LoadQuestDetails(Field* fields)