make LoadFromXml usage consistent across comps (#673)

This commit is contained in:
Aaron Kimbrell
2022-07-24 21:03:22 -05:00
committed by GitHub
parent 9ed4a4f47f
commit a7fb6eb3f3
10 changed files with 14 additions and 21 deletions

View File

@@ -37,8 +37,6 @@ CharacterComponent::CharacterComponent(Entity* parent, Character* character) : C
m_CountryCode = 0;
m_LastUpdateTimestamp = std::time(nullptr);
LoadFromXML();
//Check to see if we're landing:
if (character->GetZoneID() != Game::server->GetZoneID()) {
m_IsLanding = true;
@@ -184,12 +182,7 @@ void CharacterComponent::SetGMLevel(int gmlevel) {
m_GMLevel = gmlevel;
}
void CharacterComponent::LoadFromXML() {
if (!m_Character) return;
tinyxml2::XMLDocument* doc = m_Character->GetXMLDoc();
if (!doc) return;
void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("CharacterComponent", "Failed to find char tag while loading XML!\n");