From 5d75008e6d1d4e0908f7e89458bfac353bebf084 Mon Sep 17 00:00:00 2001
From: RD42 <42702181+dashr9230@users.noreply.github.com>
Date: Sat, 29 Jun 2024 22:41:19 +0800
Subject: [PATCH] [bot] Implement `n_ResumeRecordingPlayback(...)`

* Implement `CNetGame::ResumeRecordingPlayback()`
---
 bot/net/netgame.cpp | 10 +++++++++-
 bot/net/netgame.h   |  9 ++++++---
 bot/scrcustom.cpp   |  4 ++--
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/bot/net/netgame.cpp b/bot/net/netgame.cpp
index bea46b6..3ba34fd 100644
--- a/bot/net/netgame.cpp
+++ b/bot/net/netgame.cpp
@@ -590,4 +590,12 @@ void CNetGame::PauseRecordingPlayback()
 		field_1FA = 11;
 }
 
-
+void CNetGame::ResumeRecordingPlayback()
+{
+	field_1FE = 9;
+	field_1DE = 1;
+	if(field_1FA == -1)
+		field_1EA += GetTickCount() - field_1F6 + 100;
+	else
+		field_1FA = -1;
+}
diff --git a/bot/net/netgame.h b/bot/net/netgame.h
index 2b789f4..e352b96 100644
--- a/bot/net/netgame.h
+++ b/bot/net/netgame.h
@@ -62,10 +62,12 @@ public:
 	DWORD		m_dwMapIcon[100];
 	int field_1DA;
 	int field_1DE;
-	int field_1E2;
-	char _gap1E6[12];
+	FILE *field_1E2;
+	char _gap1E6[4];
+	int field_1EA;
+	char _gap1EE[4];
 	int field_1F2;
-	char _gap1F6[4];
+	int field_1F6;
 	int field_1FA;
 	int field_1FE;
 
@@ -104,6 +106,7 @@ public:
 
 	void StopRecordingPlayback();
 	void PauseRecordingPlayback();
+	void ResumeRecordingPlayback();
 };
 
 //----------------------------------------------------
diff --git a/bot/scrcustom.cpp b/bot/scrcustom.cpp
index 3216248..b4d7eb2 100644
--- a/bot/scrcustom.cpp
+++ b/bot/scrcustom.cpp
@@ -108,8 +108,8 @@ static cell AMX_NATIVE_CALL n_PauseRecordingPlayback(AMX *amx, cell *params)
 // native ResumeRecordingPlayback()
 static cell AMX_NATIVE_CALL n_ResumeRecordingPlayback(AMX *amx, cell *params)
 {
-	// TODO: n_ResumeRecordingPlayback
-	return 0;
+	pNetGame->ResumeRecordingPlayback();
+	return 1;
 }
 
 // native SendChat(msg[])