fix: optional party phrases (#1377)

* fix: optional party phrases

Don't return early if there are no party phrases

* Update VanityUtilities.cpp
This commit is contained in:
Daniel Seiler 2024-01-02 00:08:38 +01:00 committed by GitHub
parent e54faa3820
commit 18feea5fed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -294,10 +294,8 @@ void VanityUtilities::ParseXML(const std::string& file) {
auto* partyPhrases = npcs->FirstChildElement("partyphrases"); auto* partyPhrases = npcs->FirstChildElement("partyphrases");
if (partyPhrases == nullptr) { if (partyPhrases == nullptr) {
LOG("Failed to parse party phrases"); LOG("No party phrases found");
return; } else {
}
for (auto* phrase = partyPhrases->FirstChildElement("phrase"); phrase != nullptr; for (auto* phrase = partyPhrases->FirstChildElement("phrase"); phrase != nullptr;
phrase = phrase->NextSiblingElement("phrase")) { phrase = phrase->NextSiblingElement("phrase")) {
// Get the phrase // Get the phrase
@ -310,6 +308,7 @@ void VanityUtilities::ParseXML(const std::string& file) {
m_PartyPhrases.push_back(text); m_PartyPhrases.push_back(text);
} }
}
for (auto* npc = npcs->FirstChildElement("npc"); npc != nullptr; npc = npc->NextSiblingElement("npc")) { for (auto* npc = npcs->FirstChildElement("npc"); npc != nullptr; npc = npc->NextSiblingElement("npc")) {
// Get the NPC name // Get the NPC name