From ef454ac126702dd3a17c2f647c3e434a8bd6766d Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Fri, 24 Jun 2022 02:42:28 +0200 Subject: [PATCH] Reversed CCommandLine members Fixed wrong order of 'CCommandLine::ParmValue()' methods. Float overload was first, char const* last. Added reversed members (confirmed size of 2096 bytes). --- r5dev/tier0/commandline.cpp | 8 ++++---- r5dev/tier0/commandline.h | 15 ++++++++++++++- r5dev/vproj/clientsdk.vcxproj | 1 + r5dev/vproj/clientsdk.vcxproj.filters | 3 +++ r5dev/vproj/dedicated.vcxproj | 1 + r5dev/vproj/dedicated.vcxproj.filters | 3 +++ r5dev/vproj/gamesdk.vcxproj | 1 + r5dev/vproj/gamesdk.vcxproj.filters | 3 +++ 8 files changed, 30 insertions(+), 5 deletions(-) diff --git a/r5dev/tier0/commandline.cpp b/r5dev/tier0/commandline.cpp index 97293047..c70924e4 100644 --- a/r5dev/tier0/commandline.cpp +++ b/r5dev/tier0/commandline.cpp @@ -83,20 +83,20 @@ void CCommandLine::AppendParm(const char* pszParm, const char* pszValues) //----------------------------------------------------------------------------- // Purpose: returns the argument after the one specified, or the default if not found //----------------------------------------------------------------------------- -const char* CCommandLine::ParmValue(const char* psz, const char* pDefaultVal) +float CCommandLine::ParmValue(const char* psz, float flDefaultVal) { static int index = 7; - return CallVFunc(index, this, psz, pDefaultVal); + return CallVFunc(index, this, psz, flDefaultVal); } int CCommandLine::ParmValue(const char* psz, int nDefaultVal) { static int index = 8; return CallVFunc(index, this, psz, nDefaultVal); } -float CCommandLine::ParmValue(const char* psz, float flDefaultVal) +const char* CCommandLine::ParmValue(const char* psz, const char* pDefaultVal) { static int index = 9; - return CallVFunc(index, this, psz, flDefaultVal); + return CallVFunc(index, this, psz, pDefaultVal); } //----------------------------------------------------------------------------- diff --git a/r5dev/tier0/commandline.h b/r5dev/tier0/commandline.h index 90d7c9ed..f484e977 100644 --- a/r5dev/tier0/commandline.h +++ b/r5dev/tier0/commandline.h @@ -1,6 +1,7 @@ #pragma once +#include "public/include/icommandline.h" -class CCommandLine // VTABLE @0x141369C78 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM +class CCommandLine : public ICommandLine // VTABLE @0x141369C78 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM { public: void CreateCmdLine(const char* pszCommandline); @@ -17,6 +18,18 @@ public: int FindParm(const char* psz); const char* GetParm(int nIndex); void SetParm(int nIndex, char const* pParm); + +private: + enum + { + MAX_PARAMETER_LEN = 128, + MAX_PARAMETERS = 256, + }; + + char* m_pszCmdLine; + char m_Pad[0x18]; + int m_nParmCount; + char* m_ppParms[MAX_PARAMETERS]; }; extern CCommandLine* g_pCmdLine; diff --git a/r5dev/vproj/clientsdk.vcxproj b/r5dev/vproj/clientsdk.vcxproj index 1f1c0f7c..0614882a 100644 --- a/r5dev/vproj/clientsdk.vcxproj +++ b/r5dev/vproj/clientsdk.vcxproj @@ -209,6 +209,7 @@ + diff --git a/r5dev/vproj/clientsdk.vcxproj.filters b/r5dev/vproj/clientsdk.vcxproj.filters index a97e98ea..7f33fe05 100644 --- a/r5dev/vproj/clientsdk.vcxproj.filters +++ b/r5dev/vproj/clientsdk.vcxproj.filters @@ -1523,6 +1523,9 @@ sdk\tier0 + + sdk\public\include + diff --git a/r5dev/vproj/dedicated.vcxproj b/r5dev/vproj/dedicated.vcxproj index f57ee58f..64f211eb 100644 --- a/r5dev/vproj/dedicated.vcxproj +++ b/r5dev/vproj/dedicated.vcxproj @@ -204,6 +204,7 @@ + diff --git a/r5dev/vproj/dedicated.vcxproj.filters b/r5dev/vproj/dedicated.vcxproj.filters index c5b6c6a4..a1dda7ae 100644 --- a/r5dev/vproj/dedicated.vcxproj.filters +++ b/r5dev/vproj/dedicated.vcxproj.filters @@ -1125,6 +1125,9 @@ sdk\tier0 + + sdk\public\include + diff --git a/r5dev/vproj/gamesdk.vcxproj b/r5dev/vproj/gamesdk.vcxproj index 8f18636b..a904338e 100644 --- a/r5dev/vproj/gamesdk.vcxproj +++ b/r5dev/vproj/gamesdk.vcxproj @@ -226,6 +226,7 @@ + diff --git a/r5dev/vproj/gamesdk.vcxproj.filters b/r5dev/vproj/gamesdk.vcxproj.filters index 9e31dbb0..704387a7 100644 --- a/r5dev/vproj/gamesdk.vcxproj.filters +++ b/r5dev/vproj/gamesdk.vcxproj.filters @@ -1586,6 +1586,9 @@ sdk\tier0 + + sdk\public\include +