From 20529284335fd693237048edddb68c7e1758a94a Mon Sep 17 00:00:00 2001 From: dhewg Date: Fri, 6 Jul 2012 19:37:49 +0200 Subject: [PATCH] Fall back to fs_basedir for cd keys The windows cd installer and steam write it to that location. --- neo/framework/Session.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/neo/framework/Session.cpp b/neo/framework/Session.cpp index 6ece7f7f..02118560 100644 --- a/neo/framework/Session.cpp +++ b/neo/framework/Session.cpp @@ -2961,6 +2961,11 @@ void idSessionLocal::ReadCDKey( void ) { filename = "../" BASE_GAMEDIR "/" CDKEY_FILE; f = fileSystem->OpenExplicitFileRead( fileSystem->RelativePathToOSPath( filename, "fs_configpath" ) ); + + // try the install path, which is where the cd installer and steam put it + if ( !f ) + f = fileSystem->OpenExplicitFileRead( fileSystem->RelativePathToOSPath( filename, "fs_basepath" ) ); + if ( !f ) { common->Printf( "Couldn't read %s.\n", filename.c_str() ); cdkey[ 0 ] = '\0'; @@ -2975,6 +2980,11 @@ void idSessionLocal::ReadCDKey( void ) { filename = "../" BASE_GAMEDIR "/" XPKEY_FILE; f = fileSystem->OpenExplicitFileRead( fileSystem->RelativePathToOSPath( filename, "fs_configpath" ) ); + + // try the install path, which is where the cd installer and steam put it + if ( !f ) + f = fileSystem->OpenExplicitFileRead( fileSystem->RelativePathToOSPath( filename, "fs_basepath" ) ); + if ( !f ) { common->Printf( "Couldn't read %s.\n", filename.c_str() ); xpkey[ 0 ] = '\0';