mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Vmap: Introduce skipping of antiportals and unreachable mogp (#26331)
* Vmap: Introduce skipping of antiportals and unreachable mogp
* Reduce differences with master branch
* Update VMAP and MMAP versions
* Update MMAPs version
Co-authored-by: jackpoz <giacomopoz@gmail.com>
(cherry picked from commit d5f1fefe7f)
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
#include "DetourNavMesh.h"
|
||||
|
||||
const uint32 MMAP_MAGIC = 0x4d4d4150; // 'MMAP'
|
||||
#define MMAP_VERSION 14
|
||||
#define MMAP_VERSION 15
|
||||
|
||||
struct MmapTileHeader
|
||||
{
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
namespace VMAP
|
||||
{
|
||||
const char VMAP_MAGIC[] = "VMAP_4.A";
|
||||
const char RAW_VMAP_MAGIC[] = "VMAP04A"; // used in extracted vmap files with raw data
|
||||
const char VMAP_MAGIC[] = "VMAP_4.B";
|
||||
const char RAW_VMAP_MAGIC[] = "VMAP04B"; // used in extracted vmap files with raw data
|
||||
const char GAMEOBJECT_MODELS[] = "GameObjectModels.dtree";
|
||||
|
||||
// defined in VMapManager2.cpp currently...
|
||||
|
||||
@@ -230,6 +230,7 @@ bool ExtractSingleWmo(std::string& fname)
|
||||
|
||||
fseek(output, 8, SEEK_SET); // store the correct no of vertices
|
||||
fwrite(&Wmo_nVertices, sizeof(int), 1, output);
|
||||
// store the correct no of groups
|
||||
fwrite(&groupCount, sizeof(uint32), 1, output);
|
||||
fclose(output);
|
||||
|
||||
|
||||
@@ -76,11 +76,6 @@ bool WMORoot::open()
|
||||
f.read(&flags, 2);
|
||||
f.read(&numLod, 2);
|
||||
}
|
||||
else if (!strcmp(fourcc, "MOGN"))
|
||||
{
|
||||
GroupNames.resize(size);
|
||||
f.read(GroupNames.data(), size);
|
||||
}
|
||||
else if (!strcmp(fourcc, "MODS"))
|
||||
{
|
||||
DoodadData.Sets.resize(size / sizeof(WMO::MODS));
|
||||
@@ -130,6 +125,11 @@ bool WMORoot::open()
|
||||
DoodadData.Spawns.resize(size / sizeof(WMO::MODD));
|
||||
f.read(DoodadData.Spawns.data(), size);
|
||||
}
|
||||
else if (!strcmp(fourcc, "MOGN"))
|
||||
{
|
||||
GroupNames.resize(size);
|
||||
f.read(GroupNames.data(), size);
|
||||
}
|
||||
else if (!strcmp(fourcc, "GFID"))
|
||||
{
|
||||
// full LOD reading code for reference
|
||||
@@ -546,6 +546,10 @@ uint32 WMOGroup::GetLiquidTypeId(uint32 liquidTypeId)
|
||||
|
||||
bool WMOGroup::ShouldSkip(WMORoot const* root) const
|
||||
{
|
||||
// skip unreachable
|
||||
if (mogpFlags & 0x80)
|
||||
return true;
|
||||
|
||||
// skip antiportals
|
||||
if (mogpFlags & 0x4000000)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user