aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/mmaps_generator/MapBuilder.cpp184
-rw-r--r--src/tools/mmaps_generator/MapBuilder.h2
-rw-r--r--src/tools/mmaps_generator/PathCommon.h10
-rw-r--r--src/tools/mmaps_generator/PathGenerator.cpp10
4 files changed, 54 insertions, 152 deletions
diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp
index f7f5dcc3102..bccd0291115 100644
--- a/src/tools/mmaps_generator/MapBuilder.cpp
+++ b/src/tools/mmaps_generator/MapBuilder.cpp
@@ -16,6 +16,7 @@
*/
#include "MapBuilder.h"
+#include "Containers.h"
#include "MapTree.h"
#include "MMapDefines.h"
#include "ModelInstance.h"
@@ -880,81 +881,19 @@ namespace MMAP
return true;
if (m_skipJunkMaps)
- switch (mapID)
- {
- case 13: // test.wdt
- case 25: // ScottTest.wdt
- case 29: // Test.wdt
- case 42: // Colin.wdt
- case 169: // EmeraldDream.wdt (unused, and very large)
- case 451: // development.wdt
- case 573: // ExteriorTest.wdt
- case 597: // CraigTest.wdt
- case 605: // development_nonweighted.wdt
- case 606: // QA_DVD.wdt
- case 651: // ElevatorSpawnTest.wdt
- case 1060: // LevelDesignLand-DevOnly.wdt
- case 1181: // PattyMackTestGarrisonBldgMap.wdt
- case 1264: // Propland-DevOnly.wdt
- case 1270: // devland3.wdt
- case 1310: // Expansion5QAModelMap.wdt
- case 1407: // GorgrondFinaleScenarioMap.wdt (zzzOld)
- case 1427: // PattyMackTestGarrisonBldgMap2.wdt
- case 1451: // TanaanLegionTest.wdt
- case 1454: // ArtifactAshbringerOrigin.wdt
- case 1457: // FXlDesignLand-DevOnly.wdt
- case 1471: // 1466.wdt (Dungeon Test Map 1466)
- case 1499: // Artifact-Warrior Fury Acquisition.wdt (oldArtifact - Warrior Fury Acquisition)
- case 1537: // BoostExperience.wdt (zzOLD - Boost Experience)
- case 1538: // Karazhan Scenario.wdt (test)
- case 1549: // TechTestSeamlessWorldTransitionA.wdt
- case 1550: // TechTestSeamlessWorldTransitionB.wdt
- case 1555: // TransportBoostExperienceAllianceGunship.wdt
- case 1556: // TransportBoostExperienceHordeGunship.wdt
- case 1561: // TechTestCosmeticParentPerformance.wdt
- case 1582: // Artifact?DalaranVaultAcquisition.wdt // no, this weird symbol is not an encoding error.
- case 1584: // JulienTestLand-DevOnly.wdt
- case 1586: // AssualtOnStormwind.wdt (Assault on Stormwind - Dev Map)
- case 1588: // DevMapA.wdt
- case 1589: // DevMapB.wdt
- case 1590: // DevMapC.wdt
- case 1591: // DevMapD.wdt
- case 1592: // DevMapE.wdt
- case 1593: // DevMapF.wdt
- case 1594: // DevMapG.wdt
- case 1603: // AbyssalMaw_Interior_Scenario.wdt
- case 1670: // BrokenshorePristine.wdt
- return true;
- default:
- if (isTransportMap(mapID))
- return true;
- break;
- }
+ {
+ if (isDevMap(mapID))
+ return true;
+
+ if (isTransportMap(mapID))
+ return true;
+ }
if (m_skipBattlegrounds)
- switch (mapID)
- {
- case 30: // Alterac Valley
- case 37: // ?
- case 489: // Warsong Gulch
- case 529: // Arathi Basin
- case 566: // Eye of the Storm
- case 607: // Strand of the Ancients
- case 628: // Isle of Conquest
- case 726: // Twin Peaks
- case 727: // Silvershard Mines
- case 761: // The Battle for Gilneas
- case 968: // Rated Eye of the Storm
- case 998: // Temple of Kotmogu
- case 1010: // CTF3
- case 1105: // Deepwind Gorge
- case 1280: // Southshore vs. Tarren Mill
- case 1681: // Arathi Basin Winter
- case 1803: // Seething Shore
- return true;
- default:
- break;
- }
+ {
+ if (isBattlegroundMap(mapID))
+ return true;
+ }
return false;
}
@@ -962,85 +901,26 @@ namespace MMAP
/**************************************************************************/
bool MapBuilder::isTransportMap(uint32 mapID)
{
- switch (mapID)
- {
- // transport maps
- case 582:
- case 584:
- case 586:
- case 587:
- case 588:
- case 589:
- case 590:
- case 591:
- case 592:
- case 593:
- case 594:
- case 596:
- case 610:
- case 612:
- case 613:
- case 614:
- case 620:
- case 621:
- case 622:
- case 623:
- case 641:
- case 642:
- case 647:
- case 662:
- case 672:
- case 673:
- case 674:
- case 712:
- case 713:
- case 718:
- case 738:
- case 739:
- case 740:
- case 741:
- case 742:
- case 743:
- case 747:
- case 748:
- case 749:
- case 750:
- case 762:
- case 763:
- case 765:
- case 766:
- case 767:
- case 1113:
- case 1132:
- case 1133:
- case 1172:
- case 1173:
- case 1192:
- case 1231:
- case 1459:
- case 1476:
- case 1484:
- case 1555:
- case 1556:
- case 1559:
- case 1560:
- case 1628:
- case 1637:
- case 1638:
- case 1639:
- case 1649:
- case 1650:
- case 1711:
- case 1751:
- case 1752:
- case 1856:
- case 1857:
- case 1902:
- case 1903:
- return true;
- default:
- return false;
- }
+ if (MapEntry const* map = Trinity::Containers::MapGetValuePtr(sMapStore, mapID))
+ return map->MapType == 3;
+
+ return false;
+ }
+
+ bool MapBuilder::isDevMap(uint32 mapID)
+ {
+ if (MapEntry const* map = Trinity::Containers::MapGetValuePtr(sMapStore, mapID))
+ return (map->Flags & 0x2) != 0;
+
+ return false;
+ }
+
+ bool MapBuilder::isBattlegroundMap(uint32 mapID)
+ {
+ if (MapEntry const* map = Trinity::Containers::MapGetValuePtr(sMapStore, mapID))
+ return map->InstanceType == 3;
+
+ return false;
}
bool MapBuilder::isContinentMap(uint32 mapID)
diff --git a/src/tools/mmaps_generator/MapBuilder.h b/src/tools/mmaps_generator/MapBuilder.h
index 8942ad68d11..f2fd5d296d7 100644
--- a/src/tools/mmaps_generator/MapBuilder.h
+++ b/src/tools/mmaps_generator/MapBuilder.h
@@ -145,6 +145,8 @@ namespace MMAP
bool shouldSkipMap(uint32 mapID);
bool isTransportMap(uint32 mapID);
+ bool isDevMap(uint32 mapID);
+ bool isBattlegroundMap(uint32 mapID);
bool isContinentMap(uint32 mapID);
bool shouldSkipTile(uint32 mapID, uint32 tileX, uint32 tileY);
diff --git a/src/tools/mmaps_generator/PathCommon.h b/src/tools/mmaps_generator/PathCommon.h
index 2a951323d22..173f091e2ac 100644
--- a/src/tools/mmaps_generator/PathCommon.h
+++ b/src/tools/mmaps_generator/PathCommon.h
@@ -20,6 +20,7 @@
#include "Common.h"
#include <string>
+#include <unordered_map>
#include <vector>
#ifndef _WIN32
@@ -121,6 +122,15 @@ namespace MMAP
return LISTFILE_OK;
}
+
+ struct MapEntry
+ {
+ uint8 MapType = 0;
+ int8 InstanceType = 0;
+ int32 Flags = 0;
+ };
+
+ extern std::unordered_map<uint32, MapEntry> sMapStore;
}
#endif
diff --git a/src/tools/mmaps_generator/PathGenerator.cpp b/src/tools/mmaps_generator/PathGenerator.cpp
index 2589ae9c875..932395b984a 100644
--- a/src/tools/mmaps_generator/PathGenerator.cpp
+++ b/src/tools/mmaps_generator/PathGenerator.cpp
@@ -33,6 +33,11 @@ constexpr char Readme[] =
#include "Info/readme.txt"
};
+namespace MMAP
+{
+ std::unordered_map<uint32, MapEntry> sMapStore;
+}
+
using namespace MMAP;
namespace
@@ -323,6 +328,11 @@ std::unordered_map<uint32, std::vector<uint32>> LoadMap(std::string const& local
parentMapId = int16(record.GetUInt16("CosmeticParentMapID"));
if (parentMapId != -1)
mapData[parentMapId].push_back(record.GetId());
+
+ MapEntry& map = sMapStore[record.GetId()];
+ map.MapType = record.GetUInt8("MapType");
+ map.InstanceType = record.GetUInt8("InstanceType");
+ map.Flags = record.GetInt32("Flags1");
}
}
catch (std::exception const& e)