Magic numbers cleanup:
- Replace many magic numbers with constants - Use enum for vehicle flags/seat flags - Correct structure for ItemRandomSuffixEntry --HG-- branch : trunk
This commit is contained in:
@@ -240,7 +240,7 @@ void PlayerMenu::SendTalking(uint32 textID)
|
||||
|
||||
if (!pGossip)
|
||||
{
|
||||
for (uint32 i = 0; i < 8; ++i)
|
||||
for (uint32 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i)
|
||||
{
|
||||
data << float(0);
|
||||
data << "Greetings $N";
|
||||
@@ -256,8 +256,8 @@ void PlayerMenu::SendTalking(uint32 textID)
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string Text_0[8], Text_1[8];
|
||||
for (int i = 0; i < 8; ++i)
|
||||
std::string Text_0[MAX_LOCALES], Text_1[MAX_LOCALES];
|
||||
for (int i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i)
|
||||
{
|
||||
Text_0[i] = pGossip->Options[i].Text_0;
|
||||
Text_1[i] = pGossip->Options[i].Text_1;
|
||||
@@ -267,14 +267,14 @@ void PlayerMenu::SendTalking(uint32 textID)
|
||||
{
|
||||
if (NpcTextLocale const *nl = sObjectMgr.GetNpcTextLocale(textID))
|
||||
{
|
||||
for (int i = 0; i < 8; ++i)
|
||||
for (int i = 0; i < MAX_LOCALES; ++i)
|
||||
{
|
||||
sObjectMgr.GetLocaleString(nl->Text_0[i], loc_idx, Text_0[i]);
|
||||
sObjectMgr.GetLocaleString(nl->Text_1[i], loc_idx, Text_1[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 8; ++i)
|
||||
for (int i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i)
|
||||
{
|
||||
data << pGossip->Options[i].Probability;
|
||||
|
||||
@@ -290,7 +290,7 @@ void PlayerMenu::SendTalking(uint32 textID)
|
||||
|
||||
data << pGossip->Options[i].Language;
|
||||
|
||||
for (int j = 0; j < 3; ++j)
|
||||
for (int j = 0; j < MAX_GOSSIP_TEXT_EMOTES; ++j)
|
||||
{
|
||||
data << pGossip->Options[i].Emotes[j]._Delay;
|
||||
data << pGossip->Options[i].Emotes[j]._Emote;
|
||||
@@ -306,7 +306,7 @@ void PlayerMenu::SendTalking(char const * title, char const * text)
|
||||
{
|
||||
WorldPacket data(SMSG_NPC_TEXT_UPDATE, 50); // guess size
|
||||
data << uint32(0);
|
||||
for (uint32 i = 0; i < 8; ++i)
|
||||
for (uint32 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i)
|
||||
{
|
||||
data << float(0);
|
||||
data << title;
|
||||
|
||||
Reference in New Issue
Block a user