From 1e9130f39350b9d0c9620aa08cbd05d0a3a8c19d Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:30:45 +0800 Subject: [PATCH] [bot] Implement/match `CNetGame::FUNC_5(...)` --- bot/net/netgame.cpp | 28 ++++++++++++++++++++++++++++ bot/net/netgame.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/bot/net/netgame.cpp b/bot/net/netgame.cpp index af7b019..5d62886 100644 --- a/bot/net/netgame.cpp +++ b/bot/net/netgame.cpp @@ -872,6 +872,34 @@ void CNetGame::SendCommand(char *szCommand) GetRakClient()->RPC(RPC_ServerCommand,&bsParams,HIGH_PRIORITY,RELIABLE,0,false); } +DWORD *GLOBAL_7; +INCAR_SYNC_DATA *GLOBAL_6; +DWORD GLOBAL_5; + +void CNetGame::FUNC_5(FILE *a1, DWORD a2) +{ + DWORD i=0; + + if(0x43 * (a2 / 0x43) != a2) + { + //logprintf("NPC: Total failure. File doesn't have correct data alignment for driver recording."); + exit(1); + } + GLOBAL_5 = a2 / 0x43; + if(GLOBAL_6) + free(GLOBAL_6); + if(GLOBAL_7) + free(GLOBAL_7); + GLOBAL_6 = (INCAR_SYNC_DATA *)calloc(1, sizeof(INCAR_SYNC_DATA) * GLOBAL_5); + GLOBAL_7 = (DWORD *)calloc(1, sizeof(DWORD) * GLOBAL_5); + while(!feof(a1)) + { + fread(&GLOBAL_7[i], 1, sizeof(DWORD), a1); + fread(&GLOBAL_6[i], 1, sizeof(INCAR_SYNC_DATA), a1); + i++; + } +} + void CNetGame::StopRecordingPlayback() { field_1DE = 0; diff --git a/bot/net/netgame.h b/bot/net/netgame.h index 2e033bb..6a39653 100644 --- a/bot/net/netgame.h +++ b/bot/net/netgame.h @@ -121,6 +121,8 @@ public: float GetMyZAngle(); void SetMyZAngle(float fAngle); + void FUNC_5(FILE *a1, DWORD a2); + void StopRecordingPlayback(); void PauseRecordingPlayback(); void ResumeRecordingPlayback();