diff options
Diffstat (limited to 'src/tools/map_extractor')
| -rw-r--r-- | src/tools/map_extractor/System.cpp | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index d4db0591a30..0bd5064bbfe 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -325,51 +325,6 @@ void HandleArgs(int argc, char* arg[]) } } -uint32 ReadBuild(int locale) -{ - // include build info file also - std::string filename = Trinity::StringFormat("component.wow-%s.txt", localeNames[locale]); - //printf("Read %s file... ", filename.c_str()); - - CASC::FileHandle dbcFile = CASC::OpenFile(CascStorage, filename.c_str(), CASC_LOCALE_ALL); - if (!dbcFile) - { - printf("Locale %s not installed.\n", localeNames[locale]); - return 0; - } - - char buff[512]; - DWORD readBytes = 0; - CASC::ReadFile(dbcFile, buff, 512, &readBytes); - if (!readBytes) - { - printf("Fatal error: Not found %s file!\n", filename.c_str()); - exit(1); - } - - std::string text = std::string(buff, readBytes); - - size_t pos = text.find("version=\""); - size_t pos1 = pos + strlen("version=\""); - size_t pos2 = text.find("\"", pos1); - if (pos == text.npos || pos2 == text.npos || pos1 >= pos2) - { - printf("Fatal error: Invalid %s file format!\n", filename.c_str()); - exit(1); - } - - std::string build_str = text.substr(pos1,pos2-pos1); - - int build = atoi(build_str.c_str()); - if (build <= 0) - { - printf("Fatal error: Invalid %s file format!\n", filename.c_str()); - exit(1); - } - - return build; -} - void ReadMapDBC() { printf("Read Map.db2 file...\n"); @@ -1384,7 +1339,7 @@ int main(int argc, char * arg[]) if ((CONF_extract & EXTRACT_DBC) == 0) { FirstLocale = i; - build = ReadBuild(i); + build = CASC::GetBuildNumber(CascStorage); if (!build) { CascStorage.reset(); @@ -1396,7 +1351,7 @@ int main(int argc, char * arg[]) } //Extract DBC files - uint32 tempBuild = ReadBuild(i); + uint32 tempBuild = CASC::GetBuildNumber(CascStorage); if (!tempBuild) { CascStorage.reset(); |
