mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
feat(Core/Tools): mmaps working with mapID >= 1000 (#2321)
This commit is contained in:
@@ -88,14 +88,14 @@ namespace MMAP
|
||||
void MapBuilder::discoverTiles()
|
||||
{
|
||||
std::vector<std::string> files;
|
||||
uint32 mapID, tileX, tileY, tileID, count = 0;
|
||||
uint32 mapID, tileX, tileY, tileID, count = 0, fsize = 0;
|
||||
char filter[12];
|
||||
|
||||
printf("Discovering maps... ");
|
||||
getDirContents(files, "maps");
|
||||
for (uint32 i = 0; i < files.size(); ++i)
|
||||
{
|
||||
mapID = uint32(atoi(files[i].substr(0,3).c_str()));
|
||||
mapID = uint32(atoi(files[i].substr(0, files[i].size() - 8).c_str()));
|
||||
if (std::find(m_tiles.begin(), m_tiles.end(), mapID) == m_tiles.end())
|
||||
{
|
||||
m_tiles.emplace_back(MapTiles(mapID, new std::set<uint32>));
|
||||
@@ -107,7 +107,7 @@ namespace MMAP
|
||||
getDirContents(files, "vmaps", "*.vmtree");
|
||||
for (uint32 i = 0; i < files.size(); ++i)
|
||||
{
|
||||
mapID = uint32(atoi(files[i].substr(0,3).c_str()));
|
||||
mapID = uint32(atoi(files[i].substr(0, files[i].size() - 7).c_str()));
|
||||
if (std::find(m_tiles.begin(), m_tiles.end(), mapID) == m_tiles.end())
|
||||
{
|
||||
m_tiles.emplace_back(MapTiles(mapID, new std::set<uint32>));
|
||||
@@ -128,8 +128,10 @@ namespace MMAP
|
||||
getDirContents(files, "vmaps", filter);
|
||||
for (uint32 i = 0; i < files.size(); ++i)
|
||||
{
|
||||
tileX = uint32(atoi(files[i].substr(7,2).c_str()));
|
||||
tileY = uint32(atoi(files[i].substr(4,2).c_str()));
|
||||
fsize = files[i].size();
|
||||
|
||||
tileY = uint32(atoi(files[i].substr(fsize - 12, 2).c_str()));
|
||||
tileX = uint32(atoi(files[i].substr(fsize - 9, 2).c_str()));
|
||||
tileID = StaticMapTree::packTileID(tileY, tileX);
|
||||
|
||||
tiles->insert(tileID);
|
||||
@@ -141,8 +143,10 @@ namespace MMAP
|
||||
getDirContents(files, "maps", filter);
|
||||
for (uint32 i = 0; i < files.size(); ++i)
|
||||
{
|
||||
tileY = uint32(atoi(files[i].substr(3,2).c_str()));
|
||||
tileX = uint32(atoi(files[i].substr(5,2).c_str()));
|
||||
fsize = files[i].size();
|
||||
|
||||
tileY = uint32(atoi(files[i].substr(fsize - 8, 2).c_str()));
|
||||
tileX = uint32(atoi(files[i].substr(fsize - 6, 2).c_str()));
|
||||
tileID = StaticMapTree::packTileID(tileX, tileY);
|
||||
|
||||
if (tiles->insert(tileID).second)
|
||||
|
||||
Reference in New Issue
Block a user