diff --git a/LibBSP/Source/Structs/BSP/DisplacementVertex.cs b/LibBSP/Source/Structs/BSP/DisplacementVertex.cs
index 341cf0f..e7a9988 100644
--- a/LibBSP/Source/Structs/BSP/DisplacementVertex.cs
+++ b/LibBSP/Source/Structs/BSP/DisplacementVertex.cs
@@ -104,6 +104,42 @@ namespace LibBSP {
Parent = parent;
}
+ ///
+ /// Creates a new by copying the fields in , using
+ /// to get and
+ /// to use when creating the new .
+ /// If the 's 's is different from
+ /// the one from , it does not matter, because fields are copied by name.
+ ///
+ /// The to copy.
+ ///
+ /// The to use as the of the new .
+ /// Use null to use the 's instead.
+ ///
+ public DisplacementVertex(DisplacementVertex source, ILump parent) {
+ Parent = parent;
+
+ if (parent != null && parent.Bsp != null) {
+ if (source.Parent != null && source.Parent.Bsp != null && source.Parent.Bsp.version == parent.Bsp.version && source.LumpVersion == parent.LumpInfo.version) {
+ Data = new byte[source.Data.Length];
+ Array.Copy(source.Data, Data, source.Data.Length);
+ return;
+ } else {
+ Data = new byte[GetStructLength(parent.Bsp.version, parent.LumpInfo.version)];
+ }
+ } else {
+ if (source.Parent != null && source.Parent.Bsp != null) {
+ Data = new byte[GetStructLength(source.Parent.Bsp.version, source.Parent.LumpInfo.version)];
+ } else {
+ Data = new byte[GetStructLength(MapType.Undefined, 0)];
+ }
+ }
+
+ Normal = source.Normal;
+ Magnitude = source.Magnitude;
+ Alpha = source.Alpha;
+ }
+
///
/// Factory method to parse a byte array into a object.
///