Persist Weapons (#1647)

This commit is contained in:
gir489
2023-07-09 17:01:42 -04:00
committed by GitHub
parent 5607c58c7e
commit 3dd9be8a95
13 changed files with 902 additions and 760 deletions

View File

@ -127,17 +127,17 @@ namespace big
const weapon_component& gta_data_service::weapon_component_by_hash(std::uint32_t hash)
{
for (const auto& component : m_weapons_cache.weapon_components)
if (component.second.m_hash == hash)
return component.second;
for (const auto& [name, component] : m_weapons_cache.weapon_components)
if (component.m_hash == hash)
return component;
return gta_data_service::empty_component;
}
const weapon_component& gta_data_service::weapon_component_by_name(std::string name)
{
for (const auto& component : m_weapons_cache.weapon_components)
if (component.first == name)
return component.second;
for (const auto& [name_key, component] : m_weapons_cache.weapon_components)
if (name_key == name)
return component;
return gta_data_service::empty_component;
}