File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,12 @@ float Engine::GetIPT() { // IntervalPerTick
110110 }
111111 return 1 .0f / sar.game ->Tickrate ();
112112}
113+ int Engine::GetMaxClients () {
114+ if (this ->GetMaxClientsOrig () == 0 ) {
115+ return server->gpGlobals ->maxClients ;
116+ }
117+ return this ->GetMaxClientsOrig ();
118+ }
113119int Engine::GetTick () {
114120 return (this ->GetMaxClients () < 2 || engine->demoplayer ->IsPlaying ()) ? *this ->tickcount : TIME_TO_TICKS (*this ->net_time );
115121}
@@ -978,7 +984,7 @@ bool Engine::Init() {
978984 this ->GetLocalPlayer = this ->engineClient ->Original <_GetLocalPlayer>(Offsets::GetLocalPlayer);
979985 this ->GetViewAngles = this ->engineClient ->Original <_GetViewAngles>(Offsets::GetViewAngles);
980986 this ->SetViewAngles = this ->engineClient ->Original <_SetViewAngles>(Offsets::SetViewAngles);
981- this ->GetMaxClients = this ->engineClient ->Original <_GetMaxClients>(Offsets::GetMaxClients);
987+ this ->GetMaxClientsOrig = this ->engineClient ->Original <_GetMaxClients>(Offsets::GetMaxClients);
982988 this ->GetGameDirectory = this ->engineClient ->Original <_GetGameDirectory>(Offsets::GetGameDirectory);
983989 this ->GetSaveDirName = this ->engineClient ->Original <_GetSaveDirName>(Offsets::GetSaveDirName);
984990 this ->DebugDrawPhysCollide = this ->engineClient ->Original <_DebugDrawPhysCollide>(Offsets::DebugDrawPhysCollide);
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ class Engine : public Module {
6767 _GetLocalPlayer GetLocalPlayer = nullptr ;
6868 _GetViewAngles GetViewAngles = nullptr ;
6969 _SetViewAngles SetViewAngles = nullptr ;
70- _GetMaxClients GetMaxClients = nullptr ;
70+ _GetMaxClients GetMaxClientsOrig = nullptr ;
7171 _GetGameDirectory GetGameDirectory = nullptr ;
7272 _GetSaveDirName GetSaveDirName = nullptr ;
7373 _GetActiveSplitScreenPlayerSlot GetActiveSplitScreenPlayerSlot = nullptr ;
@@ -125,6 +125,7 @@ class Engine : public Module {
125125public:
126126 void ExecuteCommand (const char *cmd, bool immediately = false );
127127 float GetIPT ();
128+ int GetMaxClients ();
128129 int GetTick ();
129130 float ToTime (int tick);
130131 int GetLocalPlayerIndex ();
You can’t perform that action at this time.
0 commit comments