mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-23 09:02:38 +08:00
Persist Weapons (#1647)
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user