Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Tools/MapExtractor: use std::string for camera folder
Browse files Browse the repository at this point in the history
  • Loading branch information
AriDEV3 committed Feb 27, 2024
1 parent 06bc958 commit 40541c5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/tools/map_extractor/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ uint32 ReadBuild(int locale)
exit(1);
}

char buff[512];
char buff[512] = { 0 };
DWORD readBytes = 0;
SFileReadFile(dbcFile, buff, 512, &readBytes, NULL);
if (!readBytes)
Expand All @@ -246,9 +246,10 @@ uint32 ReadBuild(int locale)

std::string text = buff;
SFileCloseFile(dbcFile);
std::string version = "version=\"";

size_t pos = text.find("version=\"");
size_t pos1 = pos + strlen("version=\"");
size_t pos = text.find(version);
size_t pos1 = pos + version.length();
size_t pos2 = text.find("\"", pos1);
if (pos == text.npos || pos2 == text.npos || pos1 >= pos2)
{
Expand Down Expand Up @@ -1144,8 +1145,9 @@ void ExtractCameraFiles(int locale, bool basicLocale)
for (std::string thisFile : camerafiles)
{
std::string filename = path;
std::string camerasFolder = "Cameras\\";
HANDLE dbcFile = NULL;
filename += (thisFile.c_str() + strlen("Cameras\\"));
filename += (thisFile.c_str() + camerasFolder.length());

if (FileExists(filename.c_str()))
continue;
Expand Down

0 comments on commit 40541c5

Please sign in to comment.