feat(protections): block receive pickup (#933)
This commit is contained in:
parent
4c45d40df1
commit
fa7e5e5a34
@ -233,8 +233,9 @@ namespace big
|
||||
bool desync_kick = false;
|
||||
bool rid_join = false;
|
||||
bool lessen_breakups = false; // disabled by default due to anticheat concerns
|
||||
bool receive_pickup = false;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(protections, script_events, rid_join, lessen_breakups, desync_kick)
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(protections, script_events, rid_join, lessen_breakups, desync_kick, receive_pickup)
|
||||
} protections{};
|
||||
|
||||
struct self
|
||||
|
@ -101,6 +101,8 @@ namespace big
|
||||
|
||||
detour_hook_helper::add<hooks::received_array_update>("RAU", g_pointers->m_received_array_update);
|
||||
|
||||
detour_hook_helper::add<hooks::receive_pickup>("RPI", g_pointers->m_receive_pickup);
|
||||
|
||||
g_hooking = this;
|
||||
}
|
||||
|
||||
|
@ -145,6 +145,8 @@ namespace big
|
||||
static void* infinite_train_crash(void* carriage);
|
||||
|
||||
static bool received_array_update(rage::netArrayHandlerBase* array, CNetGamePlayer* sender, rage::datBitBuffer* buffer, int size, std::int16_t cycle);
|
||||
|
||||
static bool receive_pickup(rage::netObject* netobject, void* unk, CPed* ped);
|
||||
};
|
||||
|
||||
class minhook_keepalive
|
||||
|
15
src/hooks/protections/receive_pickup.cpp
Normal file
15
src/hooks/protections/receive_pickup.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include "hooking.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
bool hooks::receive_pickup(rage::netObject* object, void* unk, CPed* ped)
|
||||
{
|
||||
if (g.protections.receive_pickup)
|
||||
{
|
||||
g_notification_service->push_error("PROTECTIONS"_T.data(), "Blocked pickup");
|
||||
return false;
|
||||
}
|
||||
|
||||
return g_hooking->get_original<hooks::receive_pickup>()(object, unk, ped);
|
||||
}
|
||||
}
|
@ -812,6 +812,12 @@ namespace big
|
||||
m_received_array_update = ptr.as<PVOID>();
|
||||
});
|
||||
|
||||
// Receive Pickup
|
||||
main_batch.add("RPI", "49 8B 80 ? ? ? ? 48 85 C0 74 0C F6 80 ? ? ? ? ? 75 03 32 C0 C3", [this](memory::handle ptr)
|
||||
{
|
||||
m_receive_pickup = ptr.as<PVOID>();
|
||||
});
|
||||
|
||||
auto mem_region = memory::module("GTA5.exe");
|
||||
if (!main_batch.run(mem_region))
|
||||
{
|
||||
|
@ -237,6 +237,8 @@ namespace big
|
||||
functions::get_entity_attached_to m_get_entity_attached_to;
|
||||
|
||||
PVOID m_received_array_update;
|
||||
|
||||
PVOID m_receive_pickup{};
|
||||
};
|
||||
|
||||
inline pointers* g_pointers{};
|
||||
|
@ -45,6 +45,9 @@ namespace big
|
||||
ImGui::Checkbox("LESSEN_BREAKUP_KICK"_T.data(), &g.protections.lessen_breakups);
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("LESSEN_BREAKUP_KICK_DESCRIPTION"_T.data());
|
||||
ImGui::Checkbox("Receive Pickup", &g.protections.receive_pickup);
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("This prevents any pickup from the ground such as unwanted money drops.\nAttention: Normal pickups are also no longer possible.");
|
||||
ImGui::EndGroup();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user