fix(cache): weapon cache weapon types array not filled properly when filling from cache file (#1726)
This commit is contained in:
parent
d12c1309c4
commit
8c097f0915
@ -163,8 +163,7 @@ namespace big
|
||||
|
||||
load_peds();
|
||||
load_vehicles();
|
||||
LOG(INFO) << "Loading " << m_weapons_cache.weapon_map.size() << " weapons from cache.";
|
||||
LOG(INFO) << "Loading " << m_weapons_cache.weapon_components.size() << " weapon components from cache.";
|
||||
load_weapons();
|
||||
|
||||
LOG(VERBOSE) << "Loaded all data from cache.";
|
||||
}
|
||||
@ -205,6 +204,19 @@ namespace big
|
||||
m_vehicles_cache.free();
|
||||
}
|
||||
|
||||
void gta_data_service::load_weapons()
|
||||
{
|
||||
LOG(INFO) << "Loading " << m_weapons_cache.weapon_map.size() << " weapons from cache.";
|
||||
LOG(INFO) << "Loading " << m_weapons_cache.weapon_components.size() << " weapon components from cache.";
|
||||
|
||||
for (const auto& [_, weapon] : m_weapons_cache.weapon_map)
|
||||
{
|
||||
add_if_not_exists(m_weapon_types, weapon.m_weapon_type);
|
||||
}
|
||||
|
||||
std::sort(m_weapon_types.begin(), m_weapon_types.end());
|
||||
}
|
||||
|
||||
inline void parse_ped(std::vector<ped_item>& peds, std::vector<std::uint32_t>& mapped_peds, pugi::xml_document& doc)
|
||||
{
|
||||
const auto& items = doc.select_nodes("/CPedModelInfo__InitDataList/InitDatas/Item");
|
||||
|
@ -62,6 +62,7 @@ namespace big
|
||||
void load_data();
|
||||
void load_peds();
|
||||
void load_vehicles();
|
||||
void load_weapons();
|
||||
|
||||
void rebuild_cache();
|
||||
|
||||
|
Reference in New Issue
Block a user