Skip to content

Commit

Permalink
fix: optional party phrases (#1377)
Browse files Browse the repository at this point in the history
* fix: optional party phrases

Don't return early if there are no party phrases

* Update VanityUtilities.cpp
  • Loading branch information
Xiphoseer authored Jan 1, 2024
1 parent e54faa3 commit 18feea5
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions dGame/dUtilities/VanityUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,21 +294,20 @@ void VanityUtilities::ParseXML(const std::string& file) {
auto* partyPhrases = npcs->FirstChildElement("partyphrases");

if (partyPhrases == nullptr) {
LOG("Failed to parse party phrases");
return;
}

for (auto* phrase = partyPhrases->FirstChildElement("phrase"); phrase != nullptr;
phrase = phrase->NextSiblingElement("phrase")) {
// Get the phrase
auto* text = phrase->GetText();

if (text == nullptr) {
LOG("Failed to parse party phrase");
continue;
LOG("No party phrases found");
} else {
for (auto* phrase = partyPhrases->FirstChildElement("phrase"); phrase != nullptr;
phrase = phrase->NextSiblingElement("phrase")) {
// Get the phrase
auto* text = phrase->GetText();

if (text == nullptr) {
LOG("Failed to parse party phrase");
continue;
}

m_PartyPhrases.push_back(text);
}

m_PartyPhrases.push_back(text);
}

for (auto* npc = npcs->FirstChildElement("npc"); npc != nullptr; npc = npc->NextSiblingElement("npc")) {
Expand Down

0 comments on commit 18feea5

Please sign in to comment.