mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-22 16:52:30 +08:00
General fixes (#1251)
This commit is contained in:
@ -335,18 +335,11 @@ namespace big
|
||||
|
||||
nlohmann::json persist_car_service::get_model_attachments(Vehicle vehicle, bool is_towed_vehicle)
|
||||
{
|
||||
const auto replay_interface = *g_pointers->m_gta.m_replay_interface;
|
||||
|
||||
std::vector<nlohmann::json> attached_objects;
|
||||
|
||||
const auto object_interface = replay_interface->m_object_interface;
|
||||
for (int i = 0; i < object_interface->m_max_objects; i++)
|
||||
for (auto obj : pools::get_all_props())
|
||||
{
|
||||
const auto object_ptr = object_interface->get_object(i);
|
||||
if (!object_ptr)
|
||||
continue;
|
||||
|
||||
const auto object = g_pointers->m_gta.m_ptr_to_handle(object_ptr);
|
||||
const auto object = g_pointers->m_gta.m_ptr_to_handle(obj);
|
||||
if (!object)
|
||||
break;
|
||||
|
||||
@ -354,7 +347,7 @@ namespace big
|
||||
continue;
|
||||
|
||||
// Don't save tow hook.
|
||||
if (is_towed_vehicle && ENTITY::GET_ENTITY_MODEL(object) == 0xBC344305)
|
||||
if (is_towed_vehicle && ENTITY::GET_ENTITY_MODEL(object) == RAGE_JOAAT("prop_v_hook_s"))
|
||||
continue;
|
||||
|
||||
attached_objects.push_back(get_model_attachment(vehicle, object));
|
||||
@ -365,22 +358,14 @@ namespace big
|
||||
|
||||
nlohmann::json persist_car_service::get_vehicle_attachents(Vehicle vehicle)
|
||||
{
|
||||
const auto replay_interface = *g_pointers->m_gta.m_replay_interface;
|
||||
|
||||
const auto vehicle_interface = replay_interface->m_vehicle_interface;
|
||||
|
||||
std::vector<nlohmann::json> attached_vehicles;
|
||||
|
||||
Vehicle trailer;
|
||||
VEHICLE::GET_VEHICLE_TRAILER_VEHICLE(vehicle, &trailer);
|
||||
|
||||
for (int i = 0; i < vehicle_interface->m_max_vehicles; i++)
|
||||
for (auto veh : pools::get_all_vehicles())
|
||||
{
|
||||
const auto vehicle_ptr = vehicle_interface->get_vehicle(i);
|
||||
if (!vehicle_ptr)
|
||||
continue;
|
||||
|
||||
const auto object = g_pointers->m_gta.m_ptr_to_handle(vehicle_ptr);
|
||||
const auto object = g_pointers->m_gta.m_ptr_to_handle(veh);
|
||||
if (!object)
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user