diff --git a/src/function_types.hpp b/src/function_types.hpp index f672a041..e912cfc4 100644 --- a/src/function_types.hpp +++ b/src/function_types.hpp @@ -34,6 +34,12 @@ namespace rage class fwEntity; class netGameEvent; class netEventMgr; + struct rlScTaskStatus + { + void* pad = 0; + int status = 0; + int unk = 0; + }; } namespace datafile_commands @@ -108,7 +114,7 @@ namespace big::functions using get_gamer_online_state = bool (*)(int profile_index, rage::rlGamerHandle* handles, uint32_t count, int* online_state, rage::rlTaskStatus* status); using start_get_session_by_gamer_handle = bool (*)(int profile_index, rage::rlGamerHandle* handles, int count, rage::rlSessionByGamerTaskResult* result, int unk, bool* success, rage::rlTaskStatus* state); using start_matchmaking_find_sessions = bool (*)(int profile_index, int available_slots, NetworkGameFilterMatchmakingComponent* m_filter, unsigned int max_sessions, rage::rlSessionInfo* result_sessions, int* result_session_count, rage::rlTaskStatus* state); - using start_get_presence_attributes = bool (*)(int profile_index, rage::rlScHandle* handle, int num_handles, rage::rlQueryPresenceAttributesContext** contexts, int count, rage::rlTaskStatus* state); + using start_get_presence_attributes = bool (*)(int profile_index, rage::rlScHandle* handle, int num_handles, rage::rlQueryPresenceAttributesContext** contexts, int count, rage::rlScTaskStatus* state); using join_session_by_info = bool (*)(Network* network, rage::rlSessionInfo* info, int unk, int flags, rage::rlGamerHandle* handles, int handlecount); using generate_uuid = bool (*)(uint64_t* uuid); diff --git a/src/hooks/toxic/write_vehicle_proximity_migration_data_node.cpp b/src/hooks/toxic/write_vehicle_proximity_migration_data_node.cpp index 7c810641..b50ece65 100644 --- a/src/hooks/toxic/write_vehicle_proximity_migration_data_node.cpp +++ b/src/hooks/toxic/write_vehicle_proximity_migration_data_node.cpp @@ -20,6 +20,9 @@ namespace big node->m_occupants[0] = it->second.m_player_net_id; node->m_override_position = true; node->m_position = it->second.m_position; + node->m_velocity.x = 1; + node->m_velocity.y = 1; + node->m_velocity.z = 1; } } } \ No newline at end of file diff --git a/src/services/player_database/player_database_service.cpp b/src/services/player_database/player_database_service.cpp index b8d83b57..fc660690 100644 --- a/src/services/player_database/player_database_service.cpp +++ b/src/services/player_database/player_database_service.cpp @@ -327,7 +327,7 @@ namespace big for (auto& bucket : gamer_handle_buckets) { - rage::rlTaskStatus status{}; + rage::rlScTaskStatus status{}; rage::rlQueryPresenceAttributesContext contexts[bucket_size][9]{}; rage::rlQueryPresenceAttributesContext* contexts_per_player[bucket_size]{}; diff --git a/src/util/teleport.hpp b/src/util/teleport.hpp index 249a335a..40ad1522 100644 --- a/src/util/teleport.hpp +++ b/src/util/teleport.hpp @@ -83,9 +83,9 @@ namespace big::teleport || PLAYER::IS_REMOTE_PLAYER_IN_NON_CLONED_VEHICLE(player->id())) g_pointers->m_gta.m_clear_ped_tasks_network(player->get_ped(), true); - for (int i = 0; i < 15; i++) + for (int i = 0; i < 30; i++) { - script::get_current()->yield(50ms); + script::get_current()->yield(25ms); if (auto ptr = (rage::CDynamicEntity*)g_pointers->m_gta.m_handle_to_ptr(hnd)) { @@ -94,6 +94,10 @@ namespace big::teleport g_pointers->m_gta.m_migrate_object(player->get_net_game_player(), netobj, 3); } } + + auto new_coords = ENTITY::GET_ENTITY_COORDS(hnd, true); + if (SYSTEM::VDIST2(coords.x, coords.y, coords.z, new_coords.x, new_coords.y, new_coords.z) < 20 * 20 && VEHICLE::GET_PED_IN_VEHICLE_SEAT(hnd, 0, true) == ent) + break; } entity::delete_entity(hnd);