@@ -708,13 +708,22 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
708
708
{
709
709
// First, get the Steam installation.
710
710
char szSteamPath[1024 ] = {};
711
+
712
+ #ifdef BDSBASE
713
+ V_strncpy ( szSteamPath, GetSteamInstallationPath (), sizeof ( szSteamPath ) );
714
+ #else
711
715
Q_strncpy ( szSteamPath, GetSteamInstallationPath (), sizeof ( szSteamPath ) );
716
+ #endif
712
717
if ( !szSteamPath || szSteamPath[0 ] == ' \0 ' )
713
718
return nullptr ;
714
719
715
720
// Second, go to the libraryfolders.vdf and look if the appid is in them.
716
721
char szLibraryFoldersFile[1024 ] = {};
722
+ #ifdef BDSBASE
723
+ V_snprintf ( szLibraryFoldersFile, sizeof ( szLibraryFoldersFile ), " %s%s" , szSteamPath, " /config/libraryfolders.vdf" );
724
+ #else
717
725
Q_snprintf ( szLibraryFoldersFile, sizeof ( szLibraryFoldersFile ), " %s%s" , szSteamPath, " /config/libraryfolders.vdf" );
726
+ #endif
718
727
719
728
// NOTE: ReadKeyValuesFile already deletes the KV if it doesn't exist
720
729
// read the libraryfolders.vdf file
@@ -724,7 +733,11 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
724
733
725
734
// Get a string representation of the Steam AppID passed
726
735
char szAppID[32 ] = {};
736
+ #ifdef BDSBASE
737
+ V_snprintf ( szAppID, sizeof ( szAppID ), " %d" , nAppID );
738
+ #else
727
739
Q_snprintf ( szAppID, sizeof ( szAppID ), " %d" , nAppID );
740
+ #endif
728
741
729
742
// Path KV
730
743
KeyValues *pPathKV = nullptr ;
@@ -753,7 +766,11 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
753
766
// Look for the game that this mod asked for
754
767
char szInstallationPath[1024 ] = {};
755
768
// copy this string over since we're gonna delete the KV
769
+ #ifdef BDSBASE
770
+ V_strncpy ( szInstallationPath, pPathKV->GetString (), sizeof ( szInstallationPath ) );
771
+ #else
756
772
Q_strncpy ( szInstallationPath, pPathKV->GetString (), sizeof ( szInstallationPath ) );
773
+ #endif
757
774
// If it's empty somehow, error out
758
775
if ( !szInstallationPath || szInstallationPath[0 ] == ' \0 ' )
759
776
{
@@ -769,7 +786,11 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
769
786
770
787
// get the appmanifest_APPID.acf file
771
788
char szAppManifestPath[1024 ] = {};
789
+ #ifdef BDSBASE
790
+ V_snprintf ( szAppManifestPath, sizeof ( szAppManifestPath ), " %s%s%s.acf" , szInstallationPath, " /steamapps/appmanifest_" , szAppID );
791
+ #else
772
792
Q_snprintf ( szAppManifestPath, sizeof ( szAppManifestPath ), " %s%s%s.acf" , szInstallationPath, " /steamapps/appmanifest_" , szAppID );
793
+ #endif
773
794
// Reuse the root pointer to open the appmanifest file
774
795
pRootKV = ReadKeyValuesFile ( szAppManifestPath );
775
796
@@ -787,7 +808,11 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
787
808
// Get the game name to get it from the common dir.
788
809
// Again, deleting the KV after this
789
810
char szGameName[256 ] = {};
811
+ #ifdef BDSBASE
812
+ V_strncpy ( szGameName, pInstallDirKV->GetString (), sizeof ( szGameName ) );
813
+ #else
790
814
Q_strncpy ( szGameName, pInstallDirKV->GetString (), sizeof ( szGameName ) );
815
+ #endif
791
816
792
817
if ( !szGameName || szGameName[0 ] == ' \0 ' )
793
818
return nullptr ;
@@ -798,7 +823,11 @@ static const char *GetAppInstallDirNoSteam( int nAppID )
798
823
799
824
// Now that we got everything, put it all together
800
825
static char szAbsoluteGameDirPath[1024 ] = {};
826
+ #ifdef BDSBASE
827
+ V_snprintf ( szAbsoluteGameDirPath, sizeof ( szAbsoluteGameDirPath ), " %s%s%s" , szInstallationPath, " /common/" , szGameName );
828
+ #else
801
829
Q_snprintf ( szAbsoluteGameDirPath, sizeof ( szAbsoluteGameDirPath ), " %s%s%s" , szInstallationPath, " /common/" , szGameName );
830
+ #endif
802
831
803
832
// Fix the slashes before passing it
804
833
V_FixDoubleSlashes ( szAbsoluteGameDirPath );
0 commit comments