diff options
| author | Shauren <shauren.trinity@gmail.com> | 2019-07-15 19:46:15 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2019-07-15 19:46:15 +0200 |
| commit | 5ba2d3616eb9602f5b8622895b92438f3a0f3689 (patch) | |
| tree | 6fb879b463966646fb1247dac8b1dc58619aa40c /src | |
| parent | 7dc057fedb275209526133a5266e530acdd8c70d (diff) | |
Fixed mmaps_generator crash
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/mmaps_generator/PathGenerator.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/mmaps_generator/PathGenerator.cpp b/src/tools/mmaps_generator/PathGenerator.cpp index c9613ac6bde..2682ac10cf8 100644 --- a/src/tools/mmaps_generator/PathGenerator.cpp +++ b/src/tools/mmaps_generator/PathGenerator.cpp @@ -275,6 +275,9 @@ std::unordered_map<uint32, uint8> LoadLiquid(std::string const& locale) for (uint32 x = 0; x < liquidDb2.GetRecordCount(); ++x) { DB2Record record = liquidDb2.GetRecord(x); + if (!record) + continue; + liquidData[record.GetId()] = record.GetUInt8("SoundBank"); } } @@ -292,6 +295,9 @@ std::unordered_map<uint32, std::vector<uint32>> LoadMap(std::string const& local for (uint32 x = 0; x < mapDb2.GetRecordCount(); ++x) { DB2Record record = mapDb2.GetRecord(x); + if (!record) + continue; + mapData.emplace(std::piecewise_construct, std::forward_as_tuple(record.GetId()), std::forward_as_tuple()); int16 parentMapId = int16(record.GetUInt16("ParentMapID")); if (parentMapId != -1) |
