From 175b354e68ce723ac877e20e65a47ca54c105f83 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Fri, 10 Nov 2023 22:01:25 -0600 Subject: [PATCH] address feedback --- dGame/dUtilities/VanityUtilities.cpp | 31 ++++++++++++---------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/dGame/dUtilities/VanityUtilities.cpp b/dGame/dUtilities/VanityUtilities.cpp index 10e8c489..6c008524 100644 --- a/dGame/dUtilities/VanityUtilities.cpp +++ b/dGame/dUtilities/VanityUtilities.cpp @@ -32,27 +32,22 @@ void VanityUtilities::SpawnVanity() { } const uint32_t zoneID = Game::server->GetZoneID(); - if (!m_NPCs.empty()){ - for (auto& npc : m_NPCs) { - if (npc.m_ID == LWOOBJID_EMPTY) continue; - if (npc.m_LOT == 176){ - Game::zoneManager->RemoveSpawner(npc.m_ID); - } else{ - auto* entity = Game::entityManager->GetEntity(npc.m_ID); - if (!entity) continue; - entity->Smash(LWOOBJID_EMPTY, eKillType::VIOLENT); - } + + for (const auto& npc : m_NPCs) { + if (npc.m_ID == LWOOBJID_EMPTY) continue; + if (npc.m_LOT == 176){ + Game::zoneManager->RemoveSpawner(npc.m_ID); + } else{ + auto* entity = Game::entityManager->GetEntity(npc.m_ID); + if (!entity) continue; + entity->Smash(LWOOBJID_EMPTY, eKillType::VIOLENT); } - m_NPCs.clear(); - } - - if (!m_Parties.empty()){ - m_Parties.clear(); - } - if (!m_PartyPhrases.empty()){ - m_PartyPhrases.clear(); } + m_NPCs.clear(); + m_Parties.clear(); + m_PartyPhrases.clear(); + ParseXML((BinaryPathFinder::GetBinaryDir() / "vanity/NPC.xml").string()); // Loop through all parties