Tools/vmap_extractor: Move information about model type from spawns in vmap tiles to model file itself

Port From (https://github.com/TrinityCore/TrinityCore/commit/a70e758ba5eef1e8aa966cbabaee020630d2c872)
This commit is contained in:
hondacrx
2024-03-12 22:12:00 -04:00
parent 6b25d4b9b6
commit 5f0608739d
6 changed files with 36 additions and 25 deletions
+12 -3
View File
@@ -290,8 +290,7 @@ namespace Game.Collision
public class WorldModel : IModel
{
public uint Flags;
ModelFlags Flags;
uint RootWMOID;
List<GroupModel> groupModels = new();
BIH groupTree = new();
@@ -302,7 +301,7 @@ namespace Game.Collision
if ((ignoreFlags & ModelIgnoreFlags.M2) != ModelIgnoreFlags.Nothing)
{
// M2 models are not taken into account for LoS calculation if caller requested their ignoring.
if ((Flags & (uint)ModelFlags.M2) != 0)
if (Flags.HasFlag(ModelFlags.None))
return false;
}
@@ -371,6 +370,7 @@ namespace Game.Collision
return false;
reader.ReadUInt32(); //chunkSize notused
Flags = (ModelFlags)reader.ReadUInt32();
RootWMOID = reader.ReadUInt32();
// read group models
@@ -391,5 +391,14 @@ namespace Game.Collision
return groupTree.ReadFromFile(reader);
}
public bool IsM2() { return Flags.HasFlag(ModelFlags.IsM2); }
}
[Flags]
enum ModelFlags
{
None = 0x0,
IsM2 = 0x1
}
}