mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +08:00
Graceful Landing (#2660)
This commit is contained in:
parent
dfb3ecc9be
commit
49d31f8799
6
src/backend/commands/self/graceful_landing.cpp
Normal file
6
src/backend/commands/self/graceful_landing.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include "backend/bool_command.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
bool_command g_graceful_landing("gracefullanding", "GRACEFUL_LANDING", "GRACEFUL_LANDING_DESC", g.self.graceful_landing);
|
||||
}
|
@ -341,6 +341,7 @@ namespace big
|
||||
bool auto_tp = false;
|
||||
bool super_jump = false;
|
||||
bool beast_jump = false;
|
||||
bool graceful_landing = false;
|
||||
bool healthregen = false;
|
||||
float healthregenrate = 1.0f;
|
||||
bool superman = false;
|
||||
|
@ -1974,6 +1974,23 @@ enum class eTaskTypeIndex
|
||||
CTaskAnimatedFallback = 530
|
||||
};
|
||||
|
||||
enum class eTaskFlags
|
||||
{
|
||||
ParachuteWhenCoordThresholdIsReached = 1 << 3,
|
||||
CamShakeOnFall = 1 << 4,
|
||||
PlayRagdollAnim = 1 << 5,
|
||||
PlayDiveAnim = 1 << 7,
|
||||
NoFallAnimation = 1 << 10,
|
||||
NoSlowFall = 1 << 11,
|
||||
Unk12 = 1 << 12,
|
||||
SuperJump = 1 << 15,
|
||||
LandOnJump = 1 << 16,
|
||||
BeastJump = 1 << 17,
|
||||
BeastJumpWithSuper = SuperJump | BeastJump,
|
||||
GracefulLanding = NoFallAnimation | NoSlowFall | Unk12 | LandOnJump,
|
||||
RagdollOnFall = BeastJump | PlayRagdollAnim
|
||||
};
|
||||
|
||||
enum class eDoorId
|
||||
{
|
||||
VEH_EXT_DOOR_INVALID_ID = -1,
|
||||
|
@ -277,6 +277,7 @@ namespace big
|
||||
PVOID m_allow_weapons_in_vehicle;
|
||||
|
||||
PVOID m_taskjump_constructor;
|
||||
PVOID m_taskfall_constructor;
|
||||
|
||||
PVOID m_write_vehicle_proximity_migration_data_node;
|
||||
functions::migrate_object m_migrate_object;
|
||||
|
@ -115,6 +115,8 @@ namespace big
|
||||
|
||||
detour_hook_helper::add<hooks::task_jump_constructor>("TJC", g_pointers->m_gta.m_taskjump_constructor);
|
||||
|
||||
detour_hook_helper::add<hooks::task_fall_constructor>("TFC", g_pointers->m_gta.m_taskfall_constructor);
|
||||
|
||||
detour_hook_helper::add<hooks::enumerate_audio_devices>("EAD", g_pointers->m_gta.m_enumerate_audio_devices);
|
||||
detour_hook_helper::add<hooks::direct_sound_capture_create>("DSCC", g_pointers->m_gta.m_direct_sound_capture_create);
|
||||
|
||||
|
@ -151,6 +151,8 @@ namespace big
|
||||
|
||||
static __int64 task_jump_constructor(uint64_t a1, int a2);
|
||||
|
||||
static void* task_fall_constructor(uint64_t a1, int a2);
|
||||
|
||||
static CBaseModelInfo* get_model_info(rage::joaat_t hash, uint32_t* a2);
|
||||
|
||||
static int enumerate_audio_devices(CFoundDevice* found_devices, int count, int flags);
|
||||
|
14
src/hooks/misc/task_fall_constructor.cpp
Normal file
14
src/hooks/misc/task_fall_constructor.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "gta/enums.hpp"
|
||||
#include "hooking/hooking.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void* hooks::task_fall_constructor(uint64_t a1, int a2)
|
||||
{
|
||||
if (g.self.graceful_landing)
|
||||
{
|
||||
a2 |= (int)eTaskFlags::GracefulLanding;
|
||||
}
|
||||
return g_hooking->get_original<task_fall_constructor>()(a1, a2);
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
#include "gta/enums.hpp"
|
||||
#include "hooking/hooking.hpp"
|
||||
|
||||
namespace big
|
||||
@ -5,9 +6,9 @@ namespace big
|
||||
__int64 hooks::task_jump_constructor(uint64_t a1, int a2)
|
||||
{
|
||||
if (g.self.super_jump)
|
||||
a2 |= 1 << 15;
|
||||
a2 |= (int)eTaskFlags::SuperJump;
|
||||
if (g.self.beast_jump)
|
||||
a2 |= (1 << 15) | (1 << 17);
|
||||
a2 |= (int)eTaskFlags::BeastJumpWithSuper;
|
||||
return g_hooking->get_original<task_jump_constructor>()(a1, a2);
|
||||
}
|
||||
}
|
||||
|
@ -1267,6 +1267,15 @@ namespace big
|
||||
g_pointers->m_gta.m_taskjump_constructor = ptr.as<PVOID>();
|
||||
}
|
||||
},
|
||||
// Task Fall Constructor
|
||||
{
|
||||
"TFC",
|
||||
"E8 ? ? ? ? B3 04 08 98 A0",
|
||||
[](memory::handle ptr)
|
||||
{
|
||||
g_pointers->m_gta.m_taskfall_constructor = ptr.add(1).rip().as<PVOID>();
|
||||
}
|
||||
},
|
||||
// NetFilter Handle Message
|
||||
{
|
||||
"NHM",
|
||||
|
@ -40,6 +40,7 @@ namespace big
|
||||
components::command_checkbox<"invis">();
|
||||
if (g.self.invisibility)
|
||||
components::command_checkbox<"localvis">(); // TODO: does nothing in SP
|
||||
components::command_checkbox<"gracefullanding">();
|
||||
|
||||
// clang-format off
|
||||
ImGui::BeginDisabled(!*g_pointers->m_gta.m_is_session_started ||
|
||||
|
Loading…
Reference in New Issue
Block a user