Skip to content

Commit 8e031cf

Browse files
committed
move mounting stuff
1 parent 41213db commit 8e031cf

7 files changed

Lines changed: 31 additions & 9 deletions

File tree

src/game/client/cdll_client_int.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,11 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
10701070
return false;
10711071
if ( (filesystem = (IFileSystem *)appSystemFactory(FILESYSTEM_INTERFACE_VERSION, NULL)) == NULL )
10721072
return false;
1073+
#ifdef OMOD
1074+
// mounting..
1075+
mountGames();
1076+
MountAddons();
1077+
#endif
10731078
if ( (random = (IUniformRandomStream *)appSystemFactory(VENGINE_CLIENT_RANDOM_INTERFACE_VERSION, NULL)) == NULL )
10741079
return false;
10751080
if ( (gameuifuncs = (IGameUIFuncs * )appSystemFactory( VENGINE_GAMEUIFUNCS_VERSION, NULL )) == NULL )
@@ -1132,12 +1137,6 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
11321137
g_pBuildRenderablesJob->Init();
11331138
#endif
11341139

1135-
#ifdef OMOD
1136-
// mounting..
1137-
mountGames();
1138-
MountAddons();
1139-
#endif
1140-
11411140
#if defined( ALLOW_TEXT_MODE )
11421141
if (CommandLine()->FindParm("-textmode"))
11431142
g_bTextMode = true;

src/game/client/client_open.vpc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ $Project "Client (OpenMod)"
109109
$File "openmod\dynamicsky.cpp"
110110
$File "openmod\dynamicsky.h"
111111

112-
$File "openmod\mountsteamcontent.cpp"
113-
$File "openmod\mountsteamcontent.h"
112+
$File "$SRCDIR\game\shared\openmod\mountsteamcontent.cpp"
113+
$File "$SRCDIR\game\shared\openmod\mountsteamcontent.h"
114114
$File "$SRCDIR\game\shared\openmod\mountaddons.cpp"
115115
$File "$SRCDIR\game\shared\openmod\mountaddons.h"
116116

src/game/server/gameinterface.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ extern ConVar tf_mm_servermode;
136136

137137
#ifdef OMOD
138138
#include "mountaddons.h"
139+
#include "mountsteamcontent.h"
139140
#endif
140141

141142
extern IToolFrameworkServer *g_pToolFrameworkServer;
@@ -612,6 +613,11 @@ bool CServerGameDLL::DLLInit( CreateInterfaceFn appSystemFactory,
612613
return false;
613614
if ( (filesystem = (IFileSystem *)fileSystemFactory(FILESYSTEM_INTERFACE_VERSION,NULL)) == NULL )
614615
return false;
616+
#ifdef OMOD
617+
// mounting..
618+
mountGames();
619+
MountAddons();
620+
#endif
615621
if ( (gameeventmanager = (IGameEventManager2 *)appSystemFactory(INTERFACEVERSION_GAMEEVENTSMANAGER2,NULL)) == NULL )
616622
return false;
617623
if ( (datacache = (IDataCache*)appSystemFactory(DATACACHE_INTERFACE_VERSION, NULL )) == NULL )

src/game/server/server_open.vpc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ $Project "Server (OpenMod)"
249249
$File "vehicle_choreo_generic.cpp"
250250
$File "hl2\vehicle_jeep.cpp"
251251

252+
$File "$SRCDIR\game\shared\openmod\mountsteamcontent.cpp"
253+
$File "$SRCDIR\game\shared\openmod\mountsteamcontent.h"
254+
252255
$File "$SRCDIR\game\shared\openmod\weapon_toolgun.cpp"
253256
$File "$SRCDIR\game\shared\openmod\weapon_toolgun.h"
254257

src/game/shared/hl2mp/hl2mp_gamerules.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ class HL2MPViewVectors : public CViewVectors
7979
Vector m_vCrouchTraceMax;
8080
};
8181

82+
#ifdef GAME_DLL
83+
char* VarArgs(const char* format, ...);
84+
#endif
85+
8286
class CHL2MPRules : public CTeamplayRules
8387
{
8488
public:

src/game/client/openmod/mountsteamcontent.cpp renamed to src/game/shared/openmod/mountsteamcontent.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
#include "vgui_controls/Label.h"
1919
#include "vgui/ISurface.h"
2020

21+
#ifdef GAME_DLL // workaround for VarArgs
22+
#include "hl2mp_gamerules.h"
23+
#endif
24+
2125
// memdbgon must be the last include file in a .cpp file!!!
2226
#include "tier0/memdbgon.h"
2327

@@ -195,8 +199,14 @@ void addSearchPathByAppId( int nAppId )
195199

196200
void mountGames(void)
197201
{
198-
KeyValues* pMainFile, * pFileSystemInfo;
202+
KeyValues *pMainFile, *pFileSystemInfo;
203+
#ifdef CLIENT_DLL
199204
const char* gamePath = engine->GetGameDirectory();
205+
#else
206+
char gamePath[256];
207+
engine->GetGameDir( gamePath, 256 );
208+
Q_StripTrailingSlash( gamePath );
209+
#endif
200210

201211
pMainFile = new KeyValues("gamecontent.txt");
202212
if (pMainFile->LoadFromFile(filesystem, VarArgs("%s/gamecontent.txt", gamePath), "MOD"))
File renamed without changes.

0 commit comments

Comments
 (0)