Skip to content

Commit 0887cd4

Browse files
Fix bug when editor tries to save changes into .big archive
1 parent ee16dd2 commit 0887cd4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Parsers/CSFParser.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ using namespace std;
2828
if (Path.ends_with(L".BIG"))
2929
{
3030
LOGMSG("BIG archive detected. Try to find CSF file inside...");
31-
31+
3232
bool searchResult = false;
3333
char fourC[4] = {' ', ' ', ' ', ' '};
3434
std::streampos fourCharOffset = sizeof(char) * 4;
@@ -38,7 +38,7 @@ using namespace std;
3838
file.read(fourC, fourCharOffset);
3939
searchResult = (fourC[0] == FSC[0]) && (fourC[1] == FSC[1]) && (fourC[2] == FSC[2]) && (fourC[3] == FSC[3]);
4040
}
41-
41+
4242
if (!file.good())
4343
{
4444
LOGMSG(PROGRAM_CONSTANTS->CSF_NO_CSF_IN_BIG.arg(Path));
@@ -48,8 +48,10 @@ using namespace std;
4848
auto offset = file.tellg();
4949
file.clear();
5050
file.seekg(offset - fourCharOffset);
51-
51+
5252
LOGMSG("CSF file data found at offset : " + reinterpret_cast<const uint64_t&>(offset));
53+
54+
Path = Path.substr(0, Path.find_last_of('\\') + 1) + L"Data\\English\\generals.csf";
5355
}
5456

5557
LOGMSG("Attempt to read string table from \"" + Path.c_str() + "\" file...");

0 commit comments

Comments
 (0)