Core/VMaps: Fix LoS in Strand of the Ancients (#19847)

Core/Collision: Fixed MOPY chunk flags enum.

Also avoid loading destructible WMOs into vmaps.

VMap re-extraction is required.

Closes #15798.
This commit is contained in:
Golrag authored and Aokromes committed 2017-06-06 08:44:49 +02:00
1 parent c7e617b689
commit 3afbcbc0e4
4 files changed
+35 -17

No files matched your search

+20 -6
View File
@@ -350,9 +350,13 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool precise
for (int i=0; i<nTriangles; ++i)
{
// Skip no collision triangles
if (MOPY[2*i]&WMO_MATERIAL_NO_COLLISION ||
!(MOPY[2*i]&(WMO_MATERIAL_HINT|WMO_MATERIAL_COLLIDE_HIT)) )
bool isRenderFace = (MOPY[2 * i] & WMO_MATERIAL_RENDER) && !(MOPY[2 * i] & WMO_MATERIAL_DETAIL);
bool isDetail = (MOPY[2 * i] & WMO_MATERIAL_DETAIL) != 0;
bool isCollision = (MOPY[2 * i] & WMO_MATERIAL_COLLISION) != 0;
if (!isRenderFace && !isDetail && !isCollision)
continue;
// Use this triangle
for (int j=0; j<3; ++j)
{
@@ -484,7 +488,7 @@ WMOGroup::~WMOGroup()
}
WMOInstance::WMOInstance(MPQFile& f, char const* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile)
: currx(0), curry(0), wmo(NULL), doodadset(0), pos(), indx(0), id(0), d2(0), d3(0)
: currx(0), curry(0), wmo(NULL), doodadset(0), pos(), indx(0), id(0)
{
float ff[3];
f.read(&id, 4);
@@ -493,15 +497,25 @@ WMOInstance::WMOInstance(MPQFile& f, char const* WmoInstName, uint32 mapID, uint
f.read(ff,12);
rot = Vec3D(ff[0],ff[1],ff[2]);
f.read(ff,12);
pos2 = Vec3D(ff[0],ff[1],ff[2]);
pos2 = Vec3D(ff[0],ff[1],ff[2]); // bounding box corners
f.read(ff,12);
pos3 = Vec3D(ff[0],ff[1],ff[2]);
f.read(&d2,4);
pos3 = Vec3D(ff[0],ff[1],ff[2]); // bounding box corners
uint16 fflags;
f.read(&fflags, 2);
uint16 doodadSet;
f.read(&doodadSet, 2);
uint16 trash,adtId;
f.read(&adtId,2);
f.read(&trash,2);
// destructible wmo, do not dump. we can handle the vmap for these
// in dynamic tree (gameobject vmaps)
if ((fflags & 0x01) != 0)
return;
//-----------add_in _dir_file----------------
char tempname[512];