[saco] Implement/match QuitGame()

This commit is contained in:
RD42 2024-10-21 22:46:54 +08:00
parent 5048ebb8bf
commit a99e62029f
2 changed files with 17 additions and 0 deletions

View File

@ -28,6 +28,9 @@ CUnkClass15 *pUnkClass15=0;
BOOL bGameInited=FALSE;
BOOL bQuitGame=FALSE;
DWORD dwStartQuitTick=0;
WORD wVehicleComponentDebug=0;
IDirect3D9 *pD3D;
@ -428,6 +431,17 @@ void TheGraphicsLoop()
//----------------------------------------------------
void QuitGame()
{
if(pNetGame && pNetGame->GetGameState() == GAMESTATE_CONNECTED) {
pNetGame->GetRakClient()->Disconnect(500);
}
bQuitGame = TRUE;
dwStartQuitTick = GetTickCount();
}
//----------------------------------------------------
void InitSettings()
{
PCHAR szCmdLine = GetCommandLineA();

View File

@ -1,6 +1,8 @@
#pragma once
#define GAMESTATE_CONNECTED 5
#define GAMESTATE_WAIT_CONNECT 1
struct struc_41
@ -70,6 +72,7 @@ public:
void InitPools();
DWORD GetTime();
int GetGameState() { return m_iGameState; };
BOOL GetWalkStyle() { return field_3D5->bUseCJWalk; };
CPlayerPool * GetPlayerPool() { return m_pPools->pPlayerPool; };