Skip to content

Commit ea3b175

Browse files
committed
1 parent b6a9f67 commit ea3b175

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/public/filesystem_init.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,13 +708,22 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
708708
{
709709
// First, get the Steam installation.
710710
char szSteamPath[1024] = {};
711+
712+
#ifdef BDSBASE
713+
V_strncpy( szSteamPath, GetSteamInstallationPath(), sizeof( szSteamPath ) );
714+
#else
711715
Q_strncpy( szSteamPath, GetSteamInstallationPath(), sizeof( szSteamPath ) );
716+
#endif
712717
if( !szSteamPath || szSteamPath[0] == '\0' )
713718
return nullptr;
714719

715720
// Second, go to the libraryfolders.vdf and look if the appid is in them.
716721
char szLibraryFoldersFile[1024] = {};
722+
#ifdef BDSBASE
723+
V_snprintf( szLibraryFoldersFile, sizeof( szLibraryFoldersFile ), "%s%s", szSteamPath, "/config/libraryfolders.vdf" );
724+
#else
717725
Q_snprintf( szLibraryFoldersFile, sizeof( szLibraryFoldersFile ), "%s%s", szSteamPath, "/config/libraryfolders.vdf" );
726+
#endif
718727

719728
// NOTE: ReadKeyValuesFile already deletes the KV if it doesn't exist
720729
// read the libraryfolders.vdf file
@@ -724,7 +733,11 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
724733

725734
// Get a string representation of the Steam AppID passed
726735
char szAppID[32] = {};
736+
#ifdef BDSBASE
737+
V_snprintf( szAppID, sizeof( szAppID ), "%d", nAppID );
738+
#else
727739
Q_snprintf( szAppID, sizeof( szAppID ), "%d", nAppID );
740+
#endif
728741

729742
// Path KV
730743
KeyValues *pPathKV = nullptr;
@@ -753,7 +766,11 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
753766
// Look for the game that this mod asked for
754767
char szInstallationPath[1024] = {};
755768
// copy this string over since we're gonna delete the KV
769+
#ifdef BDSBASE
770+
V_strncpy( szInstallationPath, pPathKV->GetString(), sizeof( szInstallationPath ) );
771+
#else
756772
Q_strncpy( szInstallationPath, pPathKV->GetString(), sizeof( szInstallationPath ) );
773+
#endif
757774
// If it's empty somehow, error out
758775
if( !szInstallationPath || szInstallationPath[0] == '\0' )
759776
{
@@ -769,7 +786,11 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
769786

770787
// get the appmanifest_APPID.acf file
771788
char szAppManifestPath[1024] = {};
789+
#ifdef BDSBASE
790+
V_snprintf( szAppManifestPath, sizeof( szAppManifestPath ), "%s%s%s.acf", szInstallationPath, "/steamapps/appmanifest_", szAppID );
791+
#else
772792
Q_snprintf( szAppManifestPath, sizeof( szAppManifestPath ), "%s%s%s.acf", szInstallationPath, "/steamapps/appmanifest_", szAppID );
793+
#endif
773794
// Reuse the root pointer to open the appmanifest file
774795
pRootKV = ReadKeyValuesFile( szAppManifestPath );
775796

@@ -787,7 +808,11 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
787808
// Get the game name to get it from the common dir.
788809
// Again, deleting the KV after this
789810
char szGameName[256] = {};
811+
#ifdef BDSBASE
812+
V_strncpy( szGameName, pInstallDirKV->GetString(), sizeof( szGameName ) );
813+
#else
790814
Q_strncpy( szGameName, pInstallDirKV->GetString(), sizeof( szGameName ) );
815+
#endif
791816

792817
if( !szGameName || szGameName[0] == '\0' )
793818
return nullptr;
@@ -798,7 +823,11 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
798823

799824
// Now that we got everything, put it all together
800825
static char szAbsoluteGameDirPath[1024] = {};
826+
#ifdef BDSBASE
827+
V_snprintf( szAbsoluteGameDirPath, sizeof( szAbsoluteGameDirPath ), "%s%s%s", szInstallationPath, "/common/", szGameName );
828+
#else
801829
Q_snprintf( szAbsoluteGameDirPath, sizeof( szAbsoluteGameDirPath ), "%s%s%s", szInstallationPath, "/common/", szGameName );
830+
#endif
802831

803832
// Fix the slashes before passing it
804833
V_FixDoubleSlashes( szAbsoluteGameDirPath );

0 commit comments

Comments
 (0)