mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Startup/DB: Print errors on npc_text vs broadcast_text mismatches.
This commit is contained in:
@@ -5768,28 +5768,36 @@ void ObjectMgr::LoadGossipText()
|
||||
|
||||
for (uint8 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i)
|
||||
{
|
||||
gText.Options[i].Text_0 = fields[cic++].GetString();
|
||||
gText.Options[i].Text_1 = fields[cic++].GetString();
|
||||
gText.Options[i].BroadcastTextID = fields[cic++].GetUInt32();
|
||||
gText.Options[i].Language = fields[cic++].GetUInt8();
|
||||
gText.Options[i].Probability = fields[cic++].GetFloat();
|
||||
GossipTextOption& gOption = gText.Options[i];
|
||||
gOption.Text_0 = fields[cic++].GetString();
|
||||
gOption.Text_1 = fields[cic++].GetString();
|
||||
gOption.BroadcastTextID = fields[cic++].GetUInt32();
|
||||
gOption.Language = fields[cic++].GetUInt8();
|
||||
gOption.Probability = fields[cic++].GetFloat();
|
||||
|
||||
for (uint8 j = 0; j < MAX_GOSSIP_TEXT_EMOTES; ++j)
|
||||
{
|
||||
gText.Options[i].Emotes[j]._Delay = fields[cic++].GetUInt16();
|
||||
gText.Options[i].Emotes[j]._Emote = fields[cic++].GetUInt16();
|
||||
gOption.Emotes[j]._Delay = fields[cic++].GetUInt16();
|
||||
gOption.Emotes[j]._Emote = fields[cic++].GetUInt16();
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; i++)
|
||||
{
|
||||
if (gText.Options[i].BroadcastTextID)
|
||||
// check broadcast_text correctness
|
||||
if (gOption.BroadcastTextID)
|
||||
{
|
||||
if (!sObjectMgr->GetBroadcastText(gText.Options[i].BroadcastTextID))
|
||||
if (BroadcastText const* bcText = sObjectMgr->GetBroadcastText(gOption.BroadcastTextID))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "GossipText (Id: %u) in table `npc_text` has non-existing or incompatible BroadcastTextID%u %u.", id, i, gText.Options[i].BroadcastTextID);
|
||||
gText.Options[i].BroadcastTextID = 0;
|
||||
if (bcText->MaleText[DEFAULT_LOCALE] != gOption.Text_0)
|
||||
TC_LOG_ERROR("sql.sql", "Row %u in table `npc_text` has mismatch between text%u_0 and the corresponding MaleText in `broadcast_text` row %u", id, i, gOption.BroadcastTextID);
|
||||
if (bcText->FemaleText[DEFAULT_LOCALE] != gOption.Text_1)
|
||||
TC_LOG_ERROR("sql.sql", "Row %u in table `npc_text` has mismatch between text%u_1 and the corresponding FemaleText in `broadcast_text` row %u", id, i, gOption.BroadcastTextID);
|
||||
}
|
||||
else
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "GossipText (Id: %u) in table `npc_text` has non-existing or incompatible BroadcastTextID%u %u.", id, i, gOption.BroadcastTextID);
|
||||
gOption.BroadcastTextID = 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user