From 91961e40aeb3754b8c61118c4bd451c8c5c0db99 Mon Sep 17 00:00:00 2001 From: Abu Murugesan <45307264+abumsd7@users.noreply.github.com> Date: Sat, 28 Feb 2026 00:30:59 +0530 Subject: [PATCH] Update return type from void to int. There is specific case in stat box printing which requires a return value from this function to get number of rows. This is done by passing an out of bounds index as input. --- plugin_vc/game_vc/CStats.cpp | 6 ++++-- plugin_vc/game_vc/CStats.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin_vc/game_vc/CStats.cpp b/plugin_vc/game_vc/CStats.cpp index 63096ba18..cc7e4fce3 100644 --- a/plugin_vc/game_vc/CStats.cpp +++ b/plugin_vc/game_vc/CStats.cpp @@ -390,7 +390,9 @@ void CStats::LoadStats(unsigned char* bufferPointer, unsigned int structSize) } // Converted from static void __cdecl CStats::ConstructStatLine(int a1) 0x4CB085 -void CStats::ConstructStatLine(int a1) +// Updated to int - as there is a specific line in PrintStatBox function which +// expects a return value of row number by passing 99999 +int CStats::ConstructStatLine(int a1) { - ((void (__cdecl *)(int))0x4CB085)(a1); + return ((int (__cdecl *)(int))0x4CB085)(a1); } \ No newline at end of file diff --git a/plugin_vc/game_vc/CStats.h b/plugin_vc/game_vc/CStats.h index a0de03111..93e5345f5 100644 --- a/plugin_vc/game_vc/CStats.h +++ b/plugin_vc/game_vc/CStats.h @@ -138,5 +138,5 @@ class CStats static void BuildStatLine(char* a1, void* a2, int a3, void* a4, int a5); static void SaveStats(unsigned char* bufferPointer, unsigned int* structSize); static void LoadStats(unsigned char* bufferPointer, unsigned int structSize); - static void ConstructStatLine(int a1); + static int ConstructStatLine(int a1); }; \ No newline at end of file