mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-24 01:22:23 +08:00
feat(lua): added weapon and vehicle cache bindings (#2477)
* Replaced bad example in entities documentation. * Updated Lua documentation for vehicles/weapons to allow for auto generation. * Added Vector3 support to the Lua globals/locals class. * Fixed a bug with get_float in globals/locals returning an int instead of a float. * Fixed globals get_uint/set_uint using signed types for the return/parameter. * Added unsigned int helpers to the locals Lua class.
This commit is contained in:
@ -73,7 +73,7 @@ namespace big
|
||||
const ped_item& gta_data_service::ped_by_hash(uint32_t hash)
|
||||
{
|
||||
for (const auto& [name, ped] : m_peds)
|
||||
if (rage::joaat(name) == hash)
|
||||
if (ped.m_hash == hash)
|
||||
return ped;
|
||||
return gta_data_service::empty_ped;
|
||||
}
|
||||
@ -81,7 +81,7 @@ namespace big
|
||||
const vehicle_item& gta_data_service::vehicle_by_hash(uint32_t hash)
|
||||
{
|
||||
for (const auto& [name, veh] : m_vehicles)
|
||||
if (rage::joaat(name) == hash)
|
||||
if (veh.m_hash == hash)
|
||||
return veh;
|
||||
return gta_data_service::empty_vehicle;
|
||||
}
|
||||
@ -89,7 +89,7 @@ namespace big
|
||||
const weapon_item& gta_data_service::weapon_by_hash(uint32_t hash)
|
||||
{
|
||||
for (const auto& [name, weapon] : m_weapons_cache.weapon_map)
|
||||
if (rage::joaat(name) == hash)
|
||||
if (weapon.m_hash == hash)
|
||||
return weapon;
|
||||
return gta_data_service::empty_weapon;
|
||||
}
|
||||
|
Reference in New Issue
Block a user