| 67 | #endif |
| 68 | |
| 69 | void 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 |
| 106 | void CCharacterInfo::Init(CSE_ALifeTraderAbstract* trader) |