From 43b994017a560a2fa97894ebfe121375d6614b6f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 3 Feb 2008 18:53:40 +0000 Subject: basic client console --- src/filesystem/file.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/filesystem/file.cc') diff --git a/src/filesystem/file.cc b/src/filesystem/file.cc index cd6ae1b..1203d5a 100644 --- a/src/filesystem/file.cc +++ b/src/filesystem/file.cc @@ -17,6 +17,8 @@ File::~File() {} void File::open(const char * filename, ios_base::openmode mode) { file_name.assign(filename); std::string fn; + + real_name.clear(); // if moddir is set, try the mods subdir first if (moddir.size()) { @@ -26,6 +28,7 @@ void File::open(const char * filename, ios_base::openmode mode) { fn.append(filename); std::ifstream::open(fn.c_str(), mode); if (this->is_open()) { + real_name = fn; con_debug << "File opened " << fn << std::endl; return; } @@ -36,6 +39,7 @@ void File::open(const char * filename, ios_base::openmode mode) { std::ifstream::open(fn.c_str(), mode); if (this->is_open()) { con_debug << "File opened " << fn << std::endl; + real_name = fn; return; } } @@ -47,6 +51,7 @@ void File::open(const char * filename, ios_base::openmode mode) { std::ifstream::open(fn.c_str(), mode); if (this->is_open()) { con_debug << "File opened " << fn << std::endl; + real_name = fn; return; } @@ -60,6 +65,7 @@ void File::open(const char * filename, ios_base::openmode mode) { con_warn << "Could not open " << filename << std::endl; } else { con_debug << "File opened " << fn << std::endl; + real_name = fn; } } -- cgit v1.2.3