diff options
| author | Shauren <shauren.trinity@gmail.com> | 2017-06-13 23:31:41 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2017-06-13 23:31:41 +0200 |
| commit | ff1a71d6f72734f32cb83e1a24b159ff655011ad (patch) | |
| tree | 65e5714411e93502628d0a63d13d3e3acd652074 /src/tools/map_extractor | |
| parent | 1ec8228d4aec23e0e254a350b5077d7c36ebd31b (diff) | |
Tools/Extractors: Improved game build reported by extractors7.2.0/24015
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(); |
