From 79ae0f4f1f001d7857c75f8fe2727beb5710c468 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 29 Jul 2024 23:05:44 +0800 Subject: [PATCH] [saco] Match `CGame::DisplayGameText(...)` --- saco/game/game.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/saco/game/game.cpp b/saco/game/game.cpp index 72bd484..f18f6f0 100644 --- a/saco/game/game.cpp +++ b/saco/game/game.cpp @@ -15,7 +15,7 @@ void ApplyInGamePatches(); void InitAnimNameHashes(); DWORD dwDummyActiveMouseState; -char *szGameTextMessage; +unsigned char *szGameTextMessage; HWND hWindowHandle; int unnamed_10150340[210]; @@ -337,7 +337,7 @@ void CGame::ToggleKeyInputsDisabled(int a2, BOOL a3) void CGame::InitGame() { // Create a buffer for game text. - szGameTextMessage = (char*)calloc(1,513); + szGameTextMessage = (unsigned char*)calloc(1,513); // Init the keystate stuff. GameKeyStatesInit(); @@ -609,6 +609,7 @@ void CGame::ToggleRadar(int iToggle) } //----------------------------------------------------------- +// MATCH void CGame::DisplayGameText(char *szStr,int iTime,int iSize) { if(iSize > 200) return; @@ -616,9 +617,10 @@ void CGame::DisplayGameText(char *szStr,int iTime,int iSize) ScriptCommand(&text_clear_all); memset(szGameTextMessage,0,sizeof(szGameTextMessage)); // not a typo - strncpy(szGameTextMessage,szStr,512); - char *str = szGameTextMessage; + strncpy((char*)szGameTextMessage,szStr,512); + + unsigned char *str = szGameTextMessage; while(*str != 0) { if(*str >= 1 && *str < ' ' && *str != '\n') *str = ' ';