From 82f084982a45947cd203b628833f0841ba930092 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 29 Apr 2019 14:10:19 +0300 Subject: [PATCH] Fixed: Reusing CIFile to load from bnp and from regular files. --HG-- branch : develop --- code/nel/src/misc/file.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/nel/src/misc/file.cpp b/code/nel/src/misc/file.cpp index 7eae0f6a5..63b27e768 100644 --- a/code/nel/src/misc/file.cpp +++ b/code/nel/src/misc/file.cpp @@ -157,6 +157,14 @@ bool CIFile::open(const std::string &path, bool text) close(); + if ((_IsInBigFile || _IsInXMLPackFile) && path.find('@') == string::npos) + { + // CIFile can be reused to load file from bnp and from regular files. + // Last open happened to be inside bnp and close() may not set _F to NULL. + // Opening regular file will fail as _F points to bnp file. + _F = NULL; + } + // can't open empty filename if(path.empty ()) return false;