refactor(Hooks): Swapped net_event_struct with CNetworkIncrementStatEvent
This commit is contained in:
parent
f891e23760
commit
e2db18ead5
BigBaseV2/src
@ -202,6 +202,6 @@ class CNetworkIncrementStatEvent : public rage::netGameEvent
|
||||
{
|
||||
public:
|
||||
Hash m_stat; // 0x30
|
||||
std::uint32_t m_ammount; // 0x34
|
||||
std::uint32_t m_amount; // 0x34
|
||||
};
|
||||
#pragma pack(pop)
|
@ -2,6 +2,7 @@
|
||||
#include "common.hpp"
|
||||
#include "detour_hook.hpp"
|
||||
#include "gta/fwddec.hpp"
|
||||
#include "gta/net_game_event.hpp"
|
||||
#include "gta/script_thread.hpp"
|
||||
#include "script_hook.hpp"
|
||||
#include "vmt_hook.hpp"
|
||||
@ -27,7 +28,7 @@ namespace big
|
||||
static rage::eThreadState gta_thread_tick(GtaThread* a1, unsigned int a2);
|
||||
static rage::eThreadState gta_thread_kill(GtaThread* thread);
|
||||
|
||||
static bool increment_stat_event(uint64_t net_event_struct, CNetGamePlayer* sender, int64_t a3);
|
||||
static bool increment_stat_event(CNetworkIncrementStatEvent* net_event_struct, CNetGamePlayer* sender, int64_t a3);
|
||||
|
||||
static bool received_event(
|
||||
rage::netEventMgr* event_manager,
|
||||
|
@ -4,12 +4,11 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
bool hooks::increment_stat_event(uint64_t net_event_struct, CNetGamePlayer* sender, int64_t a3)
|
||||
bool hooks::increment_stat_event(CNetworkIncrementStatEvent* net_event, CNetGamePlayer* sender, int64_t a3)
|
||||
{
|
||||
Hash hash = *reinterpret_cast<DWORD*>(net_event_struct + 0x30);
|
||||
Player sender_id = sender->player_id;
|
||||
|
||||
switch (hash)
|
||||
switch (net_event->m_stat)
|
||||
{
|
||||
case RAGE_JOAAT("MPPLY_GAME_EXPLOITS"):
|
||||
case RAGE_JOAAT("MPPLY_VC_HATE"):
|
||||
@ -26,6 +25,6 @@ namespace big
|
||||
return true;
|
||||
}
|
||||
|
||||
return g_hooking->m_increment_stat_hook.get_original<decltype(&increment_stat_event)>()(net_event_struct, sender, a3);
|
||||
return g_hooking->m_increment_stat_hook.get_original<decltype(&increment_stat_event)>()(net_event, sender, a3);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user