~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/tools/tConfiguration.cpp

MergingĀ fromĀ mainline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
833
833
 
834
834
//! @param s        file stream to be used for reading later
835
835
//! @param filename name of the file to open
836
 
//! @param var      whether to look in var directory
 
836
//! @param path     whether to look in var directory
837
837
//! @return success flag
838
838
bool tConfItemBase::OpenFile( std::ifstream & s, tString const & filename, SearchPath path )
839
839
{
840
 
    bool ret = ( ( path & Config ) && tDirectories::Config().Open(s, filename ) ) || ( ( path & Var ) && tDirectories::Var().Open(s, filename ) );
 
840
    bool ret = ( ( path & Config ) && tDirectories::Config().Open(s, filename ) ) || ( ( path & Var ) && st_StringEndsWith(filename, ".cfg") && tDirectories::Var().Open(s, filename ) );
841
841
    
842
842
    static char const * section = "INCLUDE_VOTE";
843
843
    tRecorder::Playback( section, ret );
1106
1106
    if ( !tRecorder::IsPlayingBack() )
1107
1107
    {
1108
1108
        // really load include file
1109
 
        if ( !Load( tDirectories::Var(), file ) )
 
1109
        if ( !st_StringEndsWith(file, ".cfg") || !Load( tDirectories::Var(), file ) )
1110
1110
        {
1111
1111
            if (!Load( tDirectories::Config(), file ) && error )
1112
1112
            {