mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Tools/Map extractor: Minor optimization in MCNK parsing loop - look up end iterator once
(cherry picked from commit 54d969713b)
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "DB2Meta.h"
|
||||
#include "DBFilesClientList.h"
|
||||
#include "ExtractorDB2LoadInfo.h"
|
||||
#include "IteratorPair.h"
|
||||
#include "MapDefines.h"
|
||||
#include "StringFormat.h"
|
||||
#include "adt.h"
|
||||
@@ -489,9 +490,9 @@ bool ConvertADT(ChunkedFile& adt, std::string const& mapName, std::string const&
|
||||
bool hasHoles = false;
|
||||
bool hasFlightBox = false;
|
||||
|
||||
for (std::multimap<std::string, FileChunk*>::const_iterator itr = adt.chunks.lower_bound("MCNK"); itr != adt.chunks.upper_bound("MCNK"); ++itr)
|
||||
for (auto const& [_, rawChunk] : Trinity::Containers::MapEqualRange(adt.chunks, "MCNK"))
|
||||
{
|
||||
adt_MCNK* mcnk = itr->second->As<adt_MCNK>();
|
||||
adt_MCNK* mcnk = rawChunk->As<adt_MCNK>();
|
||||
|
||||
// Area data
|
||||
area_ids[mcnk->iy][mcnk->ix] = mcnk->areaid;
|
||||
@@ -536,7 +537,7 @@ bool ConvertADT(ChunkedFile& adt, std::string const& mapName, std::string const&
|
||||
}
|
||||
|
||||
// Get custom height
|
||||
if (FileChunk* chunk = itr->second->GetSubChunk("MCVT"))
|
||||
if (FileChunk* chunk = rawChunk->GetSubChunk("MCVT"))
|
||||
{
|
||||
adt_MCVT* mcvt = chunk->As<adt_MCVT>();
|
||||
// get V9 height map
|
||||
@@ -565,7 +566,7 @@ bool ConvertADT(ChunkedFile& adt, std::string const& mapName, std::string const&
|
||||
// Liquid data
|
||||
if (mcnk->sizeMCLQ > 8)
|
||||
{
|
||||
if (FileChunk* chunk = itr->second->GetSubChunk("MCLQ"))
|
||||
if (FileChunk* chunk = rawChunk->GetSubChunk("MCLQ"))
|
||||
{
|
||||
adt_MCLQ* liquid = chunk->As<adt_MCLQ>();
|
||||
int count = 0;
|
||||
|
||||
Reference in New Issue
Block a user