feat(ScriptEventHandler): Changed a2 from int64_t to CNetGamePlayer

This commit is contained in:
Yimura 2021-02-03 19:43:15 +01:00
parent 3e037a3813
commit 97c8a2cfc2
No known key found for this signature in database
GPG Key ID: 54EFAD29393A6E78
2 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ namespace big
static bool get_event_data(int32_t eventGroup, int32_t eventIndex, int64_t* args, uint32_t argCount);
static void error_screen(char* entryHeader, char* entryLine1, int instructionalKey, char* entryLine2, BOOL p4, Any p5, Any* p6, Any* p7, BOOL background);
static bool increment_stat_event(uint64_t net_event_struct, CNetGamePlayer* sender, int64_t a3);
static bool script_event_handler(std::int64_t NetEventStruct, std::int64_t CNetGamePlayer);
static bool script_event_handler(std::int64_t NetEventStruct, CNetGamePlayer* net_game_player);
static bool send_net_info_to_lobby(rage::netPlayerData* local_player, int64_t a2, int64_t a3, DWORD* a4);
};

View File

@ -6,10 +6,10 @@
namespace big
{
bool hooks::script_event_handler(std::int64_t NetEventStruct, std::int64_t CNetGamePlayer)
bool hooks::script_event_handler(std::int64_t NetEventStruct, CNetGamePlayer* net_game_player)
{
auto args = reinterpret_cast<std::int64_t*>(NetEventStruct + 0x70);
Player player = *reinterpret_cast<std::int8_t*>(CNetGamePlayer + 0x2D);
Player player = net_game_player->player_id;
int64_t hash = args[0];
@ -35,6 +35,6 @@ namespace big
LOG(INFO) << "Arg #" << i << ": " << args[i];
}
return g_hooking->m_script_event_hook.get_original<decltype(&script_event_handler)>()(NetEventStruct, CNetGamePlayer);
return g_hooking->m_script_event_hook.get_original<decltype(&script_event_handler)>()(NetEventStruct, net_game_player);
}
}