MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / load_shared

Method load_shared

ogsr_engine/COMMON_AI/character_info.cpp:69–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67#endif
68
69void CCharacterInfo::load_shared(LPCSTR)
70{
71 const ITEM_DATA& item_data = *id_to_index::GetById(m_ProfileId);
72
73 CUIXml* pXML = item_data._xml;
74 pXML->SetLocalRoot(pXML->GetRoot());
75
76 XML_NODE* item_node = pXML->NavigateToNode(id_to_index::tag_name, item_data.pos_in_file);
77 R_ASSERT3(item_node, "profile id=", *item_data.id);
78
79 pXML->SetLocalRoot(item_node);
80
81 LPCSTR spec_char = pXML->Read("specific_character", 0, NULL);
82 if (!spec_char)
83 {
84 data()->m_CharacterId = NULL;
85
86 LPCSTR char_class = pXML->Read("class", 0, NULL);
87
88 if (char_class)
89 {
90 char* buf_str = xr_strdup(char_class);
91 xr_strlwr(buf_str);
92 data()->m_Class = buf_str;
93 xr_free(buf_str);
94 }
95 else
96 data()->m_Class = NO_CHARACTER_CLASS;
97
98 data()->m_Rank = pXML->ReadInt("rank", 0, NO_RANK);
99 data()->m_Reputation = pXML->ReadInt("reputation", 0, NO_REPUTATION);
100 }
101 else
102 data()->m_CharacterId = spec_char;
103}
104
105#ifdef XRGAME_EXPORTS
106void CCharacterInfo::Init(CSE_ALifeTraderAbstract* trader)

Callers

nothing calls this directly

Calls 6

xr_strdupFunction · 0.85
xr_freeFunction · 0.85
NavigateToNodeMethod · 0.80
ReadIntMethod · 0.80
xr_strlwrFunction · 0.50
ReadMethod · 0.45

Tested by

no test coverage detected