Tools/Extractors: Completely skip trying to read patch archives with version lower than 15211 if selected build to extract is higher, these files should not even be present in WoW directory after patch 4.3.2 - this skips reading them if for some reason they still are there

This commit is contained in:
Shauren committed 2012-11-10 23:12:25 +01:00
1 parent 08f6d3e975
commit 592513c012
2 files changed
+23 -1

No files matched your search

+12 -1
View File
@@ -90,6 +90,7 @@ char const* CONF_mpq_list[]=
uint32 const Builds[] = {13164, 13205, 13287, 13329, 13596, 13623, 13914, 14007, 14333, 14480, 14545, 15005, 15050, 15211, 15354, 15595, 0};
#define LAST_DBC_IN_DATA_BUILD 13623 // after this build mpqs with dbc are back to locale folder
#define NEW_BASE_SET_BUILD 15211
char* const Locales[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU"};
TCHAR* const LocalesT[] =
@@ -1114,6 +1115,11 @@ bool LoadLocaleMPQFile(int locale)
char const* prefix = NULL;
for (int i = 0; Builds[i] && Builds[i] <= CONF_TargetBuild; ++i)
{
// Do not attempt to read older MPQ patch archives past this build, they were merged with base
// and trying to read them together with new base will not end well
if (CONF_TargetBuild >= NEW_BASE_SET_BUILD && Builds[i] < NEW_BASE_SET_BUILD)
continue;
memset(buff, 0, sizeof(buff));
if (Builds[i] > LAST_DBC_IN_DATA_BUILD)
{
@@ -1151,7 +1157,7 @@ void LoadCommonMPQFiles(uint32 build)
int count = sizeof(CONF_mpq_list) / sizeof(char*);
for (int i = 1; i < count; ++i)
{
if (build < 15211 && !strcmp("world2.MPQ", CONF_mpq_list[i])) // 4.3.2 and higher MPQ
if (build < NEW_BASE_SET_BUILD && !strcmp("world2.MPQ", CONF_mpq_list[i])) // 4.3.2 and higher MPQ
continue;
_stprintf(filename, _T("%s/Data/%s"), input_path, CONF_mpq_list[i]);
@@ -1170,6 +1176,11 @@ void LoadCommonMPQFiles(uint32 build)
char const* prefix = NULL;
for (int i = 0; Builds[i] && Builds[i] <= CONF_TargetBuild; ++i)
{
// Do not attempt to read older MPQ patch archives past this build, they were merged with base
// and trying to read them together with new base will not end well
if (CONF_TargetBuild >= NEW_BASE_SET_BUILD && Builds[i] < NEW_BASE_SET_BUILD)
continue;
memset(filename, 0, sizeof(filename));
if (Builds[i] > LAST_DBC_IN_DATA_BUILD)
{