Created
October 13, 2010 07:52
-
-
Save vermie/623651 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/contrib/vmap_extractor_v3/vmapextract/model.cpp b/contrib/vmap_extractor_v3/vmapextract/model.cpp | |
index a2493f7..3710c53 100644 | |
--- a/contrib/vmap_extractor_v3/vmapextract/model.cpp | |
+++ b/contrib/vmap_extractor_v3/vmapextract/model.cpp | |
@@ -160,6 +160,7 @@ ModelInstance::ModelInstance(MPQFile &f,const char* ModelInstName, uint32 mapID, | |
fwrite(&tileX, sizeof(uint32), 1, pDirfile); | |
fwrite(&tileY, sizeof(uint32), 1, pDirfile); | |
fwrite(&flags, sizeof(uint32), 1, pDirfile); | |
+ uint16 mddfFlags = 0; fwrite(&mddfFlags, sizeof(uint16), 1, pDirfile); // should be read as last uint16 from MDDF | |
fwrite(&adtId, sizeof(uint16), 1, pDirfile); | |
fwrite(&id, sizeof(uint32), 1, pDirfile); | |
fwrite(&pos, sizeof(float), 3, pDirfile); | |
diff --git a/contrib/vmap_extractor_v3/vmapextract/wmo.cpp b/contrib/vmap_extractor_v3/vmapextract/wmo.cpp | |
index 03cc2c1..315e96d 100644 | |
--- a/contrib/vmap_extractor_v3/vmapextract/wmo.cpp | |
+++ b/contrib/vmap_extractor_v3/vmapextract/wmo.cpp | |
@@ -434,7 +434,10 @@ WMOInstance::WMOInstance(MPQFile &f,const char* WmoInstName, uint32 mapID, uint3 | |
pos2 = Vec3D(ff[0],ff[1],ff[2]); | |
f.read(ff,12); | |
pos3 = Vec3D(ff[0],ff[1],ff[2]); | |
- f.read(&d2,4); | |
+ | |
+ uint16 modfFlags, doodadSet; | |
+ f.read(&modfFlags, 2); | |
+ f.read(&doodadSet, 2); | |
uint16 trash,adtId; | |
f.read(&adtId,2); | |
@@ -481,6 +484,7 @@ WMOInstance::WMOInstance(MPQFile &f,const char* WmoInstName, uint32 mapID, uint3 | |
fwrite(&tileX, sizeof(uint32), 1, pDirfile); | |
fwrite(&tileY, sizeof(uint32), 1, pDirfile); | |
fwrite(&flags, sizeof(uint32), 1, pDirfile); | |
+ fwrite(&modfFlags, sizeof(uint16), 1, pDirfile); | |
fwrite(&adtId, sizeof(uint16), 1, pDirfile); | |
fwrite(&id, sizeof(uint32), 1, pDirfile); | |
fwrite(&pos, sizeof(float), 3, pDirfile); | |
diff --git a/src/shared/vmap/MapTree.cpp b/src/shared/vmap/MapTree.cpp | |
index 5e34061..d63d60a 100644 | |
--- a/src/shared/vmap/MapTree.cpp | |
+++ b/src/shared/vmap/MapTree.cpp | |
@@ -370,7 +370,7 @@ namespace VMAP | |
// read model spawns | |
ModelSpawn spawn; | |
result = ModelSpawn::readFromFile(tf, spawn); | |
- if (result) | |
+ if (result && !(spawn.adtFlags & 1)) | |
{ | |
// acquire model instance | |
WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name); | |
@@ -442,7 +442,7 @@ namespace VMAP | |
// read model spawns | |
ModelSpawn spawn; | |
result = ModelSpawn::readFromFile(tf, spawn); | |
- if (result) | |
+ if (result && !(spawn.adtFlags & 1)) | |
{ | |
// release model instance | |
vm->releaseModelInstance(spawn.name); | |
diff --git a/src/shared/vmap/ModelInstance.cpp b/src/shared/vmap/ModelInstance.cpp | |
index 77b2b9c..5242155 100644 | |
--- a/src/shared/vmap/ModelInstance.cpp | |
+++ b/src/shared/vmap/ModelInstance.cpp | |
@@ -159,6 +159,7 @@ namespace VMAP | |
ERROR_LOG("Error reading ModelSpawn!"); | |
return false; | |
} | |
+ check += fread(&spawn.adtFlags, sizeof(uint16), 1, rf); | |
check += fread(&spawn.adtId, sizeof(uint16), 1, rf); | |
check += fread(&spawn.ID, sizeof(uint32), 1, rf); | |
check += fread(&spawn.iPos, sizeof(float), 3, rf); | |
@@ -173,7 +174,7 @@ namespace VMAP | |
spawn.iBound = G3D::AABox(bLow, bHigh); | |
} | |
check += fread(&nameLen, sizeof(uint32), 1, rf); | |
- if(check != (has_bound ? 17 : 11)) | |
+ if(check != (has_bound ? 18 : 12)) | |
{ | |
ERROR_LOG("Error reading ModelSpawn!"); | |
return false; | |
@@ -198,6 +199,7 @@ namespace VMAP | |
{ | |
uint32 check=0; | |
check += fwrite(&spawn.flags, sizeof(uint32), 1, wf); | |
+ check += fwrite(&spawn.adtFlags, sizeof(uint16), 1, wf); | |
check += fwrite(&spawn.adtId, sizeof(uint16), 1, wf); | |
check += fwrite(&spawn.ID, sizeof(uint32), 1, wf); | |
check += fwrite(&spawn.iPos, sizeof(float), 3, wf); | |
@@ -211,7 +213,7 @@ namespace VMAP | |
} | |
uint32 nameLen = spawn.name.length(); | |
check += fwrite(&nameLen, sizeof(uint32), 1, wf); | |
- if(check != (has_bound ? 17 : 11)) return false; | |
+ if(check != (has_bound ? 18 : 12)) return false; | |
check = fwrite(spawn.name.c_str(), sizeof(char), nameLen, wf); | |
if(check != nameLen) return false; | |
return true; | |
diff --git a/src/shared/vmap/ModelInstance.h b/src/shared/vmap/ModelInstance.h | |
index 97b3ab6..bcf7ece 100644 | |
--- a/src/shared/vmap/ModelInstance.h | |
+++ b/src/shared/vmap/ModelInstance.h | |
@@ -44,6 +44,7 @@ namespace VMAP | |
public: | |
//mapID, tileX, tileY, Flags, ID, Pos, Rot, Scale, Bound_lo, Bound_hi, name | |
uint32 flags; | |
+ uint16 adtFlags; | |
uint16 adtId; | |
uint32 ID; | |
G3D::Vector3 iPos; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment