diff --git a/ESPSharp/DataTypes/GeneratedCode/AlternateTexture.cs b/ESPSharp/DataTypes/GeneratedCode/AlternateTexture.cs index 36ad3ab..a68f592 100644 --- a/ESPSharp/DataTypes/GeneratedCode/AlternateTexture.cs +++ b/ESPSharp/DataTypes/GeneratedCode/AlternateTexture.cs @@ -99,8 +99,16 @@ public object Clone() public int CompareTo(AlternateTexture other) { - return Index.CompareTo(other.Index); - } + int result = 0; + + if (result == 0 && Name != null && other.Name != null) + result = Name.CompareTo(other.Name); + + if (result == 0 && Index != null && other.Index != null) + result = Index.CompareTo(other.Index); + + return result; + } public static bool operator >(AlternateTexture objA, AlternateTexture objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/AlternateTexture.tt b/ESPSharp/DataTypes/GeneratedCode/AlternateTexture.tt index 8a683b3..376aea0 100644 --- a/ESPSharp/DataTypes/GeneratedCode/AlternateTexture.tt +++ b/ESPSharp/DataTypes/GeneratedCode/AlternateTexture.tt @@ -1,8 +1,6 @@ <# ClassTemplate template = new ClassTemplate(); template.ClassName = "AlternateTexture"; - //template.implementReadData = false; - //template.implementWriteData = false; ClassField tempField; @@ -12,6 +10,7 @@ "Name", "Name" ); + tempField.sortIndex = 0; tempField.implementReadData = false; tempField.implementWriteData = false; template.Fields.Add(tempField); @@ -30,6 +29,7 @@ "Index", "Index" ); + tempField.sortIndex = 1; template.hashKey = tempField; template.Fields.Add(tempField); #> diff --git a/ESPSharp/DataTypes/GeneratedCode/Color.cs b/ESPSharp/DataTypes/GeneratedCode/Color.cs index 4c6e1cd..4b34e1e 100644 --- a/ESPSharp/DataTypes/GeneratedCode/Color.cs +++ b/ESPSharp/DataTypes/GeneratedCode/Color.cs @@ -109,8 +109,10 @@ public object Clone() public int CompareTo(Color other) { - return Red.CompareTo(other.Red); - } + int result = 0; + + return result; + } public static bool operator >(Color objA, Color objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/DataTypeTemplate.t4 b/ESPSharp/DataTypes/GeneratedCode/DataTypeTemplate.t4 index 62d467d..4c10b45 100644 --- a/ESPSharp/DataTypes/GeneratedCode/DataTypeTemplate.t4 +++ b/ESPSharp/DataTypes/GeneratedCode/DataTypeTemplate.t4 @@ -95,8 +95,15 @@ namespace ESPSharp.DataTypes <# if(template.isComparable) { #> public int CompareTo(<#= template.ClassName #> other) { - <# WriteCompareHashKeyCommand(template); #> - } + int result = 0; +<# foreach (var field in template.Fields.Where(f => f.sortIndex >= 0).OrderBy(o => o.sortIndex)) { #> + + if (result == 0 && <#= field.Name#> != null && other.<#= field.Name#> != null) + <# WriteCompareCommand(field); #> +<# } #> + + return result; + } public static bool operator >(<#= template.ClassName #> objA, <#= template.ClassName #> objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/DateStamp.cs b/ESPSharp/DataTypes/GeneratedCode/DateStamp.cs index c8d49de..be34d91 100644 --- a/ESPSharp/DataTypes/GeneratedCode/DateStamp.cs +++ b/ESPSharp/DataTypes/GeneratedCode/DateStamp.cs @@ -85,8 +85,10 @@ public object Clone() public int CompareTo(DateStamp other) { - return MonthsSince2001.CompareTo(other.MonthsSince2001); - } + int result = 0; + + return result; + } public static bool operator >(DateStamp objA, DateStamp objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/FormID.cs b/ESPSharp/DataTypes/GeneratedCode/FormID.cs index 6ea5295..fda4e6f 100644 --- a/ESPSharp/DataTypes/GeneratedCode/FormID.cs +++ b/ESPSharp/DataTypes/GeneratedCode/FormID.cs @@ -71,8 +71,13 @@ public object Clone() public int CompareTo(FormID other) { - return RawValue.CompareTo(other.RawValue); - } + int result = 0; + + if (result == 0 && RawValue != null && other.RawValue != null) + result = RawValue.CompareTo(other.RawValue); + + return result; + } public static bool operator >(FormID objA, FormID objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/FormID.tt b/ESPSharp/DataTypes/GeneratedCode/FormID.tt index 8a9f754..7f9c47a 100644 --- a/ESPSharp/DataTypes/GeneratedCode/FormID.tt +++ b/ESPSharp/DataTypes/GeneratedCode/FormID.tt @@ -13,6 +13,7 @@ tempField.implementReadXML = false; tempField.implementWriteXML = false; template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isReadOnly = true; template.Fields.Add(tempField); #> diff --git a/ESPSharp/DataTypes/GeneratedCode/IMADTimeColor.cs b/ESPSharp/DataTypes/GeneratedCode/IMADTimeColor.cs index d53827d..f7ccbac 100644 --- a/ESPSharp/DataTypes/GeneratedCode/IMADTimeColor.cs +++ b/ESPSharp/DataTypes/GeneratedCode/IMADTimeColor.cs @@ -121,8 +121,10 @@ public object Clone() public int CompareTo(IMADTimeColor other) { - return Time.CompareTo(other.Time); - } + int result = 0; + + return result; + } public static bool operator >(IMADTimeColor objA, IMADTimeColor objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/IMADTimeValue.cs b/ESPSharp/DataTypes/GeneratedCode/IMADTimeValue.cs index 15925c7..7cca6d0 100644 --- a/ESPSharp/DataTypes/GeneratedCode/IMADTimeValue.cs +++ b/ESPSharp/DataTypes/GeneratedCode/IMADTimeValue.cs @@ -85,8 +85,10 @@ public object Clone() public int CompareTo(IMADTimeValue other) { - return Time.CompareTo(other.Time); - } + int result = 0; + + return result; + } public static bool operator >(IMADTimeValue objA, IMADTimeValue objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/NavMeshDoor.cs b/ESPSharp/DataTypes/GeneratedCode/NavMeshDoor.cs index 6eaa7dc..51dbd14 100644 --- a/ESPSharp/DataTypes/GeneratedCode/NavMeshDoor.cs +++ b/ESPSharp/DataTypes/GeneratedCode/NavMeshDoor.cs @@ -100,8 +100,10 @@ public object Clone() public int CompareTo(NavMeshDoor other) { - return Door.CompareTo(other.Door); - } + int result = 0; + + return result; + } public static bool operator >(NavMeshDoor objA, NavMeshDoor objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/NavMeshExternalConnection.cs b/ESPSharp/DataTypes/GeneratedCode/NavMeshExternalConnection.cs index 6b7efd0..c4d1bf6 100644 --- a/ESPSharp/DataTypes/GeneratedCode/NavMeshExternalConnection.cs +++ b/ESPSharp/DataTypes/GeneratedCode/NavMeshExternalConnection.cs @@ -102,8 +102,10 @@ public object Clone() public int CompareTo(NavMeshExternalConnection other) { - return NavigationMesh.CompareTo(other.NavigationMesh); - } + int result = 0; + + return result; + } public static bool operator >(NavMeshExternalConnection objA, NavMeshExternalConnection objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/NavMeshTriangle.cs b/ESPSharp/DataTypes/GeneratedCode/NavMeshTriangle.cs index ca20866..b0a68ca 100644 --- a/ESPSharp/DataTypes/GeneratedCode/NavMeshTriangle.cs +++ b/ESPSharp/DataTypes/GeneratedCode/NavMeshTriangle.cs @@ -145,8 +145,10 @@ public object Clone() public int CompareTo(NavMeshTriangle other) { - return Vertex1.CompareTo(other.Vertex1); - } + int result = 0; + + return result; + } public static bool operator >(NavMeshTriangle objA, NavMeshTriangle objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/RegionGrass.cs b/ESPSharp/DataTypes/GeneratedCode/RegionGrass.cs index bfdde86..f62a35c 100644 --- a/ESPSharp/DataTypes/GeneratedCode/RegionGrass.cs +++ b/ESPSharp/DataTypes/GeneratedCode/RegionGrass.cs @@ -90,8 +90,10 @@ public object Clone() public int CompareTo(RegionGrass other) { - return Form.CompareTo(other.Form); - } + int result = 0; + + return result; + } public static bool operator >(RegionGrass objA, RegionGrass objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/RegionObject.cs b/ESPSharp/DataTypes/GeneratedCode/RegionObject.cs index d162226..d64479b 100644 --- a/ESPSharp/DataTypes/GeneratedCode/RegionObject.cs +++ b/ESPSharp/DataTypes/GeneratedCode/RegionObject.cs @@ -302,8 +302,10 @@ public object Clone() public int CompareTo(RegionObject other) { - return Object.CompareTo(other.Object); - } + int result = 0; + + return result; + } public static bool operator >(RegionObject objA, RegionObject objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/RegionSound.cs b/ESPSharp/DataTypes/GeneratedCode/RegionSound.cs index 6103e9e..7d3e977 100644 --- a/ESPSharp/DataTypes/GeneratedCode/RegionSound.cs +++ b/ESPSharp/DataTypes/GeneratedCode/RegionSound.cs @@ -98,8 +98,10 @@ public object Clone() public int CompareTo(RegionSound other) { - return Sound.CompareTo(other.Sound); - } + int result = 0; + + return result; + } public static bool operator >(RegionSound objA, RegionSound objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/StaticPlacement.cs b/ESPSharp/DataTypes/GeneratedCode/StaticPlacement.cs index 49e5afc..f81f2c0 100644 --- a/ESPSharp/DataTypes/GeneratedCode/StaticPlacement.cs +++ b/ESPSharp/DataTypes/GeneratedCode/StaticPlacement.cs @@ -145,8 +145,31 @@ public object Clone() public int CompareTo(StaticPlacement other) { - return PositionX.CompareTo(other.PositionX); - } + int result = 0; + + if (result == 0 && PositionZ != null && other.PositionZ != null) + result = PositionZ.CompareTo(other.PositionZ); + + if (result == 0 && PositionX != null && other.PositionX != null) + result = PositionX.CompareTo(other.PositionX); + + if (result == 0 && PositionY != null && other.PositionY != null) + result = PositionY.CompareTo(other.PositionY); + + if (result == 0 && RotationX != null && other.RotationX != null) + result = RotationX.CompareTo(other.RotationX); + + if (result == 0 && RotationY != null && other.RotationY != null) + result = RotationY.CompareTo(other.RotationY); + + if (result == 0 && RotationZ != null && other.RotationZ != null) + result = RotationZ.CompareTo(other.RotationZ); + + if (result == 0 && Scale != null && other.Scale != null) + result = Scale.CompareTo(other.Scale); + + return result; + } public static bool operator >(StaticPlacement objA, StaticPlacement objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/StaticPlacement.tt b/ESPSharp/DataTypes/GeneratedCode/StaticPlacement.tt index 2090f47..537d501 100644 --- a/ESPSharp/DataTypes/GeneratedCode/StaticPlacement.tt +++ b/ESPSharp/DataTypes/GeneratedCode/StaticPlacement.tt @@ -10,6 +10,7 @@ "PositionX", "Position/X" ); + tempField.sortIndex = 1; template.hashKey = tempField; template.Fields.Add(tempField); @@ -19,6 +20,7 @@ "PositionY", "Position/Y" ); + tempField.sortIndex = 2; template.Fields.Add(tempField); tempField = @@ -27,6 +29,7 @@ "PositionZ", "Position/Z" ); + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = @@ -35,6 +38,7 @@ "RotationX", "Rotation/X" ); + tempField.sortIndex = 3; template.Fields.Add(tempField); tempField = @@ -43,6 +47,7 @@ "RotationY", "Rotation/Y" ); + tempField.sortIndex = 4; template.Fields.Add(tempField); tempField = @@ -51,6 +56,7 @@ "RotationZ", "Rotation/Z" ); + tempField.sortIndex = 5; template.Fields.Add(tempField); tempField = @@ -59,6 +65,7 @@ "Scale", "Scale" ); + tempField.sortIndex = 6; template.Fields.Add(tempField); #> <#@ include file="DataTypeTemplate.t4" once="true" #> \ No newline at end of file diff --git a/ESPSharp/DataTypes/GeneratedCode/TimeOfDayColors.cs b/ESPSharp/DataTypes/GeneratedCode/TimeOfDayColors.cs index 4bbbeff..61c5069 100644 --- a/ESPSharp/DataTypes/GeneratedCode/TimeOfDayColors.cs +++ b/ESPSharp/DataTypes/GeneratedCode/TimeOfDayColors.cs @@ -139,8 +139,10 @@ public object Clone() public int CompareTo(TimeOfDayColors other) { - return Sunrise.CompareTo(other.Sunrise); - } + int result = 0; + + return result; + } public static bool operator >(TimeOfDayColors objA, TimeOfDayColors objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/WeatherChance.cs b/ESPSharp/DataTypes/GeneratedCode/WeatherChance.cs index 0d22f01..1f19a12 100644 --- a/ESPSharp/DataTypes/GeneratedCode/WeatherChance.cs +++ b/ESPSharp/DataTypes/GeneratedCode/WeatherChance.cs @@ -99,8 +99,10 @@ public object Clone() public int CompareTo(WeatherChance other) { - return Weather.CompareTo(other.Weather); - } + int result = 0; + + return result; + } public static bool operator >(WeatherChance objA, WeatherChance objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/XYFloat.cs b/ESPSharp/DataTypes/GeneratedCode/XYFloat.cs index 096c276..aa48682 100644 --- a/ESPSharp/DataTypes/GeneratedCode/XYFloat.cs +++ b/ESPSharp/DataTypes/GeneratedCode/XYFloat.cs @@ -85,8 +85,10 @@ public object Clone() public int CompareTo(XYFloat other) { - return X.CompareTo(other.X); - } + int result = 0; + + return result; + } public static bool operator >(XYFloat objA, XYFloat objB) { diff --git a/ESPSharp/DataTypes/GeneratedCode/XYZFloat.cs b/ESPSharp/DataTypes/GeneratedCode/XYZFloat.cs index 563acdf..a8c4107 100644 --- a/ESPSharp/DataTypes/GeneratedCode/XYZFloat.cs +++ b/ESPSharp/DataTypes/GeneratedCode/XYZFloat.cs @@ -97,8 +97,10 @@ public object Clone() public int CompareTo(XYZFloat other) { - return X.CompareTo(other.X); - } + int result = 0; + + return result; + } public static bool operator >(XYZFloat objA, XYZFloat objB) { diff --git a/ESPSharp/Records/GeneratedCode/Creature.cs b/ESPSharp/Records/GeneratedCode/Creature.cs index a5317ac..db57d0c 100644 --- a/ESPSharp/Records/GeneratedCode/Creature.cs +++ b/ESPSharp/Records/GeneratedCode/Creature.cs @@ -336,8 +336,11 @@ public override void WriteData(ESPWriter writer) if (BaseStats != null) BaseStats.WriteBinary(writer); if (Factions != null) + { + Factions.Sort(); foreach (var item in Factions) item.WriteBinary(writer); + } if (DeathItem != null) DeathItem.WriteBinary(writer); if (VoiceType != null) @@ -458,6 +461,7 @@ public override void WriteDataXML(XElement ele, ElderScrollsPlugin master) ele.TryPathTo("Factions", true, out subEle); List xmlNames = new List{"Faction"}; int i = 0; + Factions.Sort(); foreach (var entry in Factions) { i = i % xmlNames.Count(); diff --git a/ESPSharp/Records/GeneratedCode/Creature.tt b/ESPSharp/Records/GeneratedCode/Creature.tt index b3465a2..c109c06 100644 --- a/ESPSharp/Records/GeneratedCode/Creature.tt +++ b/ESPSharp/Records/GeneratedCode/Creature.tt @@ -109,6 +109,7 @@ "Factions", "Factions" ); + tempField.isSorted = true; tempField.XMLSubNames = new List{"Faction"}; template.Fields.Add(tempField); diff --git a/ESPSharp/Records/GeneratedCode/NonPlayerCharacter.cs b/ESPSharp/Records/GeneratedCode/NonPlayerCharacter.cs index eca3058..e67b3c9 100644 --- a/ESPSharp/Records/GeneratedCode/NonPlayerCharacter.cs +++ b/ESPSharp/Records/GeneratedCode/NonPlayerCharacter.cs @@ -355,8 +355,11 @@ public override void WriteData(ESPWriter writer) if (Race != null) Race.WriteBinary(writer); if (ActorEffects != null) + { + ActorEffects.Sort(); foreach (var item in ActorEffects) item.WriteBinary(writer); + } if (UnarmedAttackEffect != null) UnarmedAttackEffect.WriteBinary(writer); if (UnarmedAttackAnimation != null) @@ -482,6 +485,7 @@ public override void WriteDataXML(XElement ele, ElderScrollsPlugin master) ele.TryPathTo("ActorEffects", true, out subEle); List xmlNames = new List{"ActorEffect"}; int i = 0; + ActorEffects.Sort(); foreach (var entry in ActorEffects) { i = i % xmlNames.Count(); diff --git a/ESPSharp/Records/GeneratedCode/NonPlayerCharacter.tt b/ESPSharp/Records/GeneratedCode/NonPlayerCharacter.tt index d75f5b3..24d7616 100644 --- a/ESPSharp/Records/GeneratedCode/NonPlayerCharacter.tt +++ b/ESPSharp/Records/GeneratedCode/NonPlayerCharacter.tt @@ -111,6 +111,7 @@ "ActorEffects", "ActorEffects" ); + tempField.isSorted = true; tempField.XMLSubNames = new List {"ActorEffect"}; template.Fields.Add(tempField); diff --git a/ESPSharp/Records/GeneratedCode/Perk.cs b/ESPSharp/Records/GeneratedCode/Perk.cs index b7bca53..3480338 100644 --- a/ESPSharp/Records/GeneratedCode/Perk.cs +++ b/ESPSharp/Records/GeneratedCode/Perk.cs @@ -128,8 +128,11 @@ public override void WriteData(ESPWriter writer) if (Data != null) Data.WriteBinary(writer); if (Effects != null) + { + Effects.Sort(); foreach (var item in Effects) item.WriteBinary(writer); + } } public override void WriteDataXML(XElement ele, ElderScrollsPlugin master) @@ -184,6 +187,7 @@ public override void WriteDataXML(XElement ele, ElderScrollsPlugin master) ele.TryPathTo("Effects", true, out subEle); List xmlNames = new List{"Effect"}; int i = 0; + Effects.Sort(); foreach (var entry in Effects) { i = i % xmlNames.Count(); diff --git a/ESPSharp/Records/GeneratedCode/Perk.tt b/ESPSharp/Records/GeneratedCode/Perk.tt index de03255..a22e064 100644 --- a/ESPSharp/Records/GeneratedCode/Perk.tt +++ b/ESPSharp/Records/GeneratedCode/Perk.tt @@ -80,6 +80,7 @@ "Effects", "Effects" ); + tempField.isSorted = true; tempField.XMLSubNames = new List {"Effect"}; template.Fields.Add(tempField); #> diff --git a/ESPSharp/Records/GeneratedCode/RecordTemplate.t4 b/ESPSharp/Records/GeneratedCode/RecordTemplate.t4 index 302916b..cc7ba61 100644 --- a/ESPSharp/Records/GeneratedCode/RecordTemplate.t4 +++ b/ESPSharp/Records/GeneratedCode/RecordTemplate.t4 @@ -177,8 +177,15 @@ namespace ESPSharp.Records <# if(false) { #> public int CompareTo(<#= template.ClassName #> other) { - <# WriteCompareHashKeyCommand(template); #> - } + int result = 0; +<# foreach (var field in template.Fields.Where(f => f.sortIndex >= 0).OrderBy(o => o.sortIndex)) { #> + + if (result == 0 && <#= field.Name#> != null && other.<#= field.Name#> != null) + <# WriteCompareCommand(field); #> +<# } #> + + return result; + } public static bool operator >(<#= template.ClassName #> objA, <#= template.ClassName #> objB) { diff --git a/ESPSharp/Records/GeneratedCode/Reference.cs b/ESPSharp/Records/GeneratedCode/Reference.cs index ac4e5b2..655c3d1 100644 --- a/ESPSharp/Records/GeneratedCode/Reference.cs +++ b/ESPSharp/Records/GeneratedCode/Reference.cs @@ -497,8 +497,11 @@ public override void WriteData(ESPWriter writer) if (ParentActivateOnly != null) ParentActivateOnly.WriteBinary(writer); if (ActivateParents != null) + { + ActivateParents.Sort(); foreach (var item in ActivateParents) item.WriteBinary(writer); + } if (ActivationPrompt != null) ActivationPrompt.WriteBinary(writer); if (EnableParent != null) @@ -742,6 +745,7 @@ public override void WriteDataXML(XElement ele, ElderScrollsPlugin master) ele.TryPathTo("ActivateParents", true, out subEle); List xmlNames = new List{"ActivateParent"}; int i = 0; + ActivateParents.Sort(); foreach (var entry in ActivateParents) { i = i % xmlNames.Count(); diff --git a/ESPSharp/Records/GeneratedCode/Reference.tt b/ESPSharp/Records/GeneratedCode/Reference.tt index 50838c5..71fd481 100644 --- a/ESPSharp/Records/GeneratedCode/Reference.tt +++ b/ESPSharp/Records/GeneratedCode/Reference.tt @@ -322,6 +322,7 @@ "ActivateParents", "ActivateParents" ); + tempField.isSorted = true; tempField.XMLSubNames = new List{"ActivateParent"}; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/AddedQuest.cs b/ESPSharp/SubrecordCollections/GeneratedCode/AddedQuest.cs index c1d8e45..a2017de 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/AddedQuest.cs +++ b/ESPSharp/SubrecordCollections/GeneratedCode/AddedQuest.cs @@ -128,7 +128,12 @@ public AddedQuest Clone() public int CompareTo(AddedQuest other) { - return Quest.CompareTo(other.Quest); + int result = 0; + + if (result == 0 && Quest != null && other.Quest != null) + result = Quest.CompareTo(other.Quest); + + return result; } public static bool operator >(AddedQuest objA, AddedQuest objB) diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/AddedQuest.tt b/ESPSharp/SubrecordCollections/GeneratedCode/AddedQuest.tt index 9100766..89f7b6e 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/AddedQuest.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/AddedQuest.tt @@ -14,7 +14,7 @@ "Quest", "Quest" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/BodyModel.tt b/ESPSharp/SubrecordCollections/GeneratedCode/BodyModel.tt index 4a3a769..1b36056 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/BodyModel.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/BodyModel.tt @@ -13,7 +13,7 @@ "Index", "Index" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/BodyPart.tt b/ESPSharp/SubrecordCollections/GeneratedCode/BodyPart.tt index b3b20bd..364606f 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/BodyPart.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/BodyPart.tt @@ -13,7 +13,7 @@ "PartNode", "PartNode" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/CreatureSound.tt b/ESPSharp/SubrecordCollections/GeneratedCode/CreatureSound.tt index b33086b..2936cd7 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/CreatureSound.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/CreatureSound.tt @@ -13,7 +13,7 @@ "Sound", "Sound" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/CreatureSoundData.tt b/ESPSharp/SubrecordCollections/GeneratedCode/CreatureSoundData.tt index dca34d4..842a7f1 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/CreatureSoundData.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/CreatureSoundData.tt @@ -13,7 +13,7 @@ "SoundType", "SoundType" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/DebrisModel.tt b/ESPSharp/SubrecordCollections/GeneratedCode/DebrisModel.tt index 58b2791..398a301 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/DebrisModel.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/DebrisModel.tt @@ -13,7 +13,7 @@ "Data", "Data" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/Destructable.tt b/ESPSharp/SubrecordCollections/GeneratedCode/Destructable.tt index 975c3b8..872d9be 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/Destructable.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/Destructable.tt @@ -13,7 +13,7 @@ "Header", "Header" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/DestructionStage.tt b/ESPSharp/SubrecordCollections/GeneratedCode/DestructionStage.tt index 139dc82..61d3486 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/DestructionStage.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/DestructionStage.tt @@ -13,7 +13,7 @@ "StageData", "StageData" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/DialogEndScript.tt b/ESPSharp/SubrecordCollections/GeneratedCode/DialogEndScript.tt index 4f6ff43..a435d69 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/DialogEndScript.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/DialogEndScript.tt @@ -22,7 +22,7 @@ "EmbeddedScript", "EmbeddedScript" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); #> <#@ include file="SubrecordCollectionTemplate.t4" once="true" #> \ No newline at end of file diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/Effect.tt b/ESPSharp/SubrecordCollections/GeneratedCode/Effect.tt index f72e250..c283586 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/Effect.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/Effect.tt @@ -13,7 +13,7 @@ "BaseEffect", "BaseEffect" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/EmbeddedScript.tt b/ESPSharp/SubrecordCollections/GeneratedCode/EmbeddedScript.tt index 76fb768..5ae0321 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/EmbeddedScript.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/EmbeddedScript.tt @@ -13,7 +13,7 @@ "Data", "Data" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/FaceGenData.tt b/ESPSharp/SubrecordCollections/GeneratedCode/FaceGenData.tt index bb1d7aa..3013425 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/FaceGenData.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/FaceGenData.tt @@ -14,7 +14,7 @@ "GeometrySymmetric", "Geometry/Symmetric" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/FactionRank.tt b/ESPSharp/SubrecordCollections/GeneratedCode/FactionRank.tt index 7cb5677..488ac89 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/FactionRank.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/FactionRank.tt @@ -14,7 +14,7 @@ "Rank", "Rank" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/GenderBodyData.tt b/ESPSharp/SubrecordCollections/GeneratedCode/GenderBodyData.tt index 50b9962..4e82b04 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/GenderBodyData.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/GenderBodyData.tt @@ -14,7 +14,7 @@ "BodyModels", "BodyModels" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.XMLSubName = "BodyModel"; template.Fields.Add(tempField); #> diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/GenderHeadData.tt b/ESPSharp/SubrecordCollections/GeneratedCode/GenderHeadData.tt index f9de8e4..fc1c5c9 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/GenderHeadData.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/GenderHeadData.tt @@ -14,7 +14,7 @@ "HeadModels", "HeadModels" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.XMLSubName = "HeadModel"; template.Fields.Add(tempField); #> diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/HeadModel.tt b/ESPSharp/SubrecordCollections/GeneratedCode/HeadModel.tt index 5e6fe27..6e84c93 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/HeadModel.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/HeadModel.tt @@ -13,7 +13,7 @@ "Index", "Index" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/InventoryItem.cs b/ESPSharp/SubrecordCollections/GeneratedCode/InventoryItem.cs index 14798eb..f6ee2d7 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/InventoryItem.cs +++ b/ESPSharp/SubrecordCollections/GeneratedCode/InventoryItem.cs @@ -115,7 +115,15 @@ public InventoryItem Clone() public int CompareTo(InventoryItem other) { - return Data.CompareTo(other.Data); + int result = 0; + + if (result == 0 && Data != null && other.Data != null) + result = Data.CompareTo(other.Data); + + if (result == 0 && ExtraData != null && other.ExtraData != null) + result = ExtraData.CompareTo(other.ExtraData); + + return result; } public static bool operator >(InventoryItem objA, InventoryItem objB) diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/InventoryItem.tt b/ESPSharp/SubrecordCollections/GeneratedCode/InventoryItem.tt index 210b3d2..31d33c3 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/InventoryItem.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/InventoryItem.tt @@ -14,7 +14,7 @@ "Data", "Data" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); @@ -25,6 +25,7 @@ "ExtraData", "ExtraData" ); + tempField.sortIndex = 1; template.Fields.Add(tempField); #> <#@ include file="SubrecordCollectionTemplate.t4" once="true" #> \ No newline at end of file diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/LeveledListEntry.tt b/ESPSharp/SubrecordCollections/GeneratedCode/LeveledListEntry.tt index d276ff4..9469e90 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/LeveledListEntry.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/LeveledListEntry.tt @@ -13,7 +13,7 @@ "Data", "Data" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/LocalVariable.tt b/ESPSharp/SubrecordCollections/GeneratedCode/LocalVariable.tt index d073d01..505d252 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/LocalVariable.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/LocalVariable.tt @@ -12,7 +12,7 @@ "Data", "Data" ); - template.hashKey = fileNameField; + fileNameField.sortIndex = 0; fileNameField.isRequired = true; template.Fields.Add(fileNameField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/MapMarker.tt b/ESPSharp/SubrecordCollections/GeneratedCode/MapMarker.tt index 34f04da..67321c2 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/MapMarker.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/MapMarker.tt @@ -23,7 +23,7 @@ "Name", "Name" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/MasterFileData.tt b/ESPSharp/SubrecordCollections/GeneratedCode/MasterFileData.tt index e807ce5..32ee144 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/MasterFileData.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/MasterFileData.tt @@ -12,7 +12,7 @@ "FileName", "FileName" ); - template.hashKey = fileNameField; + fileNameField.sortIndex = 0; fileNameField.isRequired = true; template.Fields.Add(fileNameField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/MessageButton.tt b/ESPSharp/SubrecordCollections/GeneratedCode/MessageButton.tt index d376330..f456288 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/MessageButton.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/MessageButton.tt @@ -13,7 +13,7 @@ "ButtonText", "ButtonText" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/Model.tt b/ESPSharp/SubrecordCollections/GeneratedCode/Model.tt index 89f3de7..450f1a6 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/Model.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/Model.tt @@ -13,7 +13,7 @@ "FileName", "FileName" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/NamedBodyPart.tt b/ESPSharp/SubrecordCollections/GeneratedCode/NamedBodyPart.tt index c201191..def7895 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/NamedBodyPart.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/NamedBodyPart.tt @@ -13,7 +13,7 @@ "PartName", "PartName" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/PackageEvent.tt b/ESPSharp/SubrecordCollections/GeneratedCode/PackageEvent.tt index 44c9213..82a9398 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/PackageEvent.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/PackageEvent.tt @@ -14,7 +14,7 @@ "Idle", "Idle" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/PerkCondition.tt b/ESPSharp/SubrecordCollections/GeneratedCode/PerkCondition.tt index a888264..c6d4a7a 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/PerkCondition.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/PerkCondition.tt @@ -13,7 +13,7 @@ "RunOn", "RunOn" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/QuestLogEntry.tt b/ESPSharp/SubrecordCollections/GeneratedCode/QuestLogEntry.tt index a4e6c4f..cd7e31a 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/QuestLogEntry.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/QuestLogEntry.tt @@ -13,7 +13,7 @@ "StageFlags", "StageFlags" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/QuestObjective.tt b/ESPSharp/SubrecordCollections/GeneratedCode/QuestObjective.tt index c25924d..b9c3160 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/QuestObjective.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/QuestObjective.tt @@ -13,7 +13,7 @@ "Index", "Index" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/QuestStage.tt b/ESPSharp/SubrecordCollections/GeneratedCode/QuestStage.tt index 1c96cb9..5bece14 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/QuestStage.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/QuestStage.tt @@ -13,7 +13,7 @@ "Index", "Index" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/QuestTarget.tt b/ESPSharp/SubrecordCollections/GeneratedCode/QuestTarget.tt index 156d8cc..7376dbf 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/QuestTarget.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/QuestTarget.tt @@ -13,7 +13,7 @@ "Target", "Target" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/RaceBodyData.tt b/ESPSharp/SubrecordCollections/GeneratedCode/RaceBodyData.tt index 9561c7a..b61acfc 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/RaceBodyData.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/RaceBodyData.tt @@ -14,7 +14,7 @@ "Male", "Male" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/RaceHeadData.tt b/ESPSharp/SubrecordCollections/GeneratedCode/RaceHeadData.tt index b157683..3dc1d08 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/RaceHeadData.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/RaceHeadData.tt @@ -14,7 +14,7 @@ "Male", "Male" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/RecipeIngredient.tt b/ESPSharp/SubrecordCollections/GeneratedCode/RecipeIngredient.tt index 5c19729..088f165 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/RecipeIngredient.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/RecipeIngredient.tt @@ -13,7 +13,7 @@ "Item", "Item" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/RecipeOutput.tt b/ESPSharp/SubrecordCollections/GeneratedCode/RecipeOutput.tt index afbb634..90c0f6b 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/RecipeOutput.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/RecipeOutput.tt @@ -13,7 +13,7 @@ "Item", "Item" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/ReferenceAmmo.tt b/ESPSharp/SubrecordCollections/GeneratedCode/ReferenceAmmo.tt index b575589..f153af7 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/ReferenceAmmo.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/ReferenceAmmo.tt @@ -13,7 +13,7 @@ "Type", "Type" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/ReferenceAudio.tt b/ESPSharp/SubrecordCollections/GeneratedCode/ReferenceAudio.tt index 5992a06..4ee1e03 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/ReferenceAudio.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/ReferenceAudio.tt @@ -23,7 +23,7 @@ "AudioLocation", "AudioLocation" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/ReferencePatrolData.tt b/ESPSharp/SubrecordCollections/GeneratedCode/ReferencePatrolData.tt index 048552f..595ab1a 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/ReferencePatrolData.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/ReferencePatrolData.tt @@ -13,7 +13,7 @@ "IdleTime", "IdleTime" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/RegionArea.tt b/ESPSharp/SubrecordCollections/GeneratedCode/RegionArea.tt index e893dbb..a35b580 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/RegionArea.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/RegionArea.tt @@ -13,7 +13,7 @@ "EdgeFallOff", "EdgeFallOff" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/RegionDataEntry.tt b/ESPSharp/SubrecordCollections/GeneratedCode/RegionDataEntry.tt index c6b63c2..4cab24b 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/RegionDataEntry.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/RegionDataEntry.tt @@ -13,7 +13,7 @@ "Header", "Header" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/Response.tt b/ESPSharp/SubrecordCollections/GeneratedCode/Response.tt index 24e52b1..af12238 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/Response.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/Response.tt @@ -13,7 +13,7 @@ "ResponseData", "ResponseData" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/SharedInfo.tt b/ESPSharp/SubrecordCollections/GeneratedCode/SharedInfo.tt index 32108c4..482fc9e 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/SharedInfo.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/SharedInfo.tt @@ -13,7 +13,7 @@ "InfoConnection", "InfoConnection" ); - template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/StaticCollectionPart.cs b/ESPSharp/SubrecordCollections/GeneratedCode/StaticCollectionPart.cs index 89c517b..7c3a1a1 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/StaticCollectionPart.cs +++ b/ESPSharp/SubrecordCollections/GeneratedCode/StaticCollectionPart.cs @@ -113,7 +113,12 @@ public StaticCollectionPart Clone() public int CompareTo(StaticCollectionPart other) { - return Static.CompareTo(other.Static); + int result = 0; + + if (result == 0 && Static != null && other.Static != null) + result = Static.CompareTo(other.Static); + + return result; } public static bool operator >(StaticCollectionPart objA, StaticCollectionPart objB) diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/StaticCollectionPart.tt b/ESPSharp/SubrecordCollections/GeneratedCode/StaticCollectionPart.tt index 535d0e2..82a5498 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/StaticCollectionPart.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/StaticCollectionPart.tt @@ -14,7 +14,7 @@ "Static", "Static" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); @@ -25,6 +25,7 @@ "Placements", "Placements" ); + tempField.isSorted = true; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/SubrecordCollectionTemplate.t4 b/ESPSharp/SubrecordCollections/GeneratedCode/SubrecordCollectionTemplate.t4 index ea4be0c..04db2d6 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/SubrecordCollectionTemplate.t4 +++ b/ESPSharp/SubrecordCollections/GeneratedCode/SubrecordCollectionTemplate.t4 @@ -214,7 +214,14 @@ namespace ESPSharp.SubrecordCollections public int CompareTo(<#= template.ClassName #> other) { - return <#= template.hashKey.Name#>.CompareTo(other.<#= template.hashKey.Name#>); + int result = 0; +<# foreach (var field in template.Fields.Where(f => f.sortIndex >= 0).OrderBy(o => o.sortIndex)) { #> + + if (result == 0 && <#= field.Name#> != null && other.<#= field.Name#> != null) + result = <#= field.Name#>.CompareTo(other.<#= field.Name#>); +<# } #> + + return result; } public static bool operator >(<#= template.ClassName #> objA, <#= template.ClassName #> objB) @@ -258,7 +265,6 @@ public class SubrecordCollectionTemplate public string ClassName; public List Fields = new List(); public bool startsWithMarker = false; - public SubrecordCollectionField hashKey = null; public bool isComparable = false; } @@ -269,6 +275,7 @@ public class SubrecordCollectionField public string Name; public string XMLPath; public string XMLSubName; + public int sortIndex = -1; public bool isRequired = false; public bool isReadOnly = false; diff --git a/ESPSharp/SubrecordCollections/GeneratedCode/TerminalMenu.tt b/ESPSharp/SubrecordCollections/GeneratedCode/TerminalMenu.tt index a36d670..35ec6e5 100644 --- a/ESPSharp/SubrecordCollections/GeneratedCode/TerminalMenu.tt +++ b/ESPSharp/SubrecordCollections/GeneratedCode/TerminalMenu.tt @@ -13,7 +13,7 @@ "ItemText", "ItemText" ); - template.hashKey = tempField; + tempField.sortIndex = 0; tempField.isRequired = true; template.Fields.Add(tempField); diff --git a/ESPSharp/SubrecordCollections/PerkEffect.cs b/ESPSharp/SubrecordCollections/PerkEffect.cs index 552295e..03ef470 100644 --- a/ESPSharp/SubrecordCollections/PerkEffect.cs +++ b/ESPSharp/SubrecordCollections/PerkEffect.cs @@ -14,7 +14,7 @@ namespace ESPSharp.SubrecordCollections { - public partial class PerkEffect : SubrecordCollection, ICloneable + public partial class PerkEffect : SubrecordCollection, ICloneable, IComparable { public PerkEffectHeader Header { get; set; } public Subrecord EffectData { get; set; } @@ -393,6 +393,80 @@ public override void ReadXML(XElement ele, ElderScrollsPlugin master) } } + public int CompareTo(PerkEffect other) + { + int result = 0; + + if (result == 0 && Header != null && other.Header != null) + result = Header.CompareTo(other.Header); + + if (result == 0 && EffectData != null && other.EffectData != null) + { + switch (Header.Type) + { + case PerkType.QuestStage: + result = (EffectData as PerkQuestStageData).CompareTo(other.EffectData as PerkQuestStageData); + break; + case PerkType.Ability: + result = (EffectData as PerkAbilityData).CompareTo(other.EffectData as PerkAbilityData); + break; + case PerkType.EntryPoint: + result = (EffectData as PerkEntryPointData).CompareTo(other.EffectData as PerkEntryPointData); + break; + } + } + + if (result == 0 && EntryPointFunctionType != null && other.EntryPointFunctionType != null) + result = EntryPointFunctionType.Value.CompareTo(other.EntryPointFunctionType.Value); + + if (result == 0 && EntryPointFunctionData != null && other.EntryPointFunctionData != null) + { + switch (EntryPointFunctionType.Value) + { + case Enums.EntryPointFunctionType.None: + result = (EntryPointFunctionData as SimpleSubrecord).Value.GetHashCode().CompareTo((other.EntryPointFunctionData as SimpleSubrecord).Value.GetHashCode()); + break; + case Enums.EntryPointFunctionType.Float: + result = (EntryPointFunctionData as SimpleSubrecord).Value.CompareTo((other.EntryPointFunctionData as SimpleSubrecord).Value); + break; + case Enums.EntryPointFunctionType.FloatFloat: + result = (EntryPointFunctionData as EntryPointRandRange).CompareTo(other.EntryPointFunctionData as EntryPointRandRange); + break; + case Enums.EntryPointFunctionType.LeveledItem: + result = (EntryPointFunctionData as RecordReference).CompareTo(other.EntryPointFunctionData as RecordReference); + break; + case Enums.EntryPointFunctionType.Script: + result = (EntryPointFunctionData as SimpleSubrecord).Value.GetHashCode().CompareTo((other.EntryPointFunctionData as SimpleSubrecord).Value.GetHashCode()); + break; + case Enums.EntryPointFunctionType.ActorValueMult: + result = (EntryPointFunctionData as EntryPointActorValMult).CompareTo(other.EntryPointFunctionData as EntryPointActorValMult); + break; + } + } + + return result; + } + + public static bool operator >(PerkEffect objA, PerkEffect objB) + { + return objA.CompareTo(objB) > 0; + } + + public static bool operator >=(PerkEffect objA, PerkEffect objB) + { + return objA.CompareTo(objB) >= 0; + } + + public static bool operator <(PerkEffect objA, PerkEffect objB) + { + return objA.CompareTo(objB) < 0; + } + + public static bool operator <=(PerkEffect objA, PerkEffect objB) + { + return objA.CompareTo(objB) <= 0; + } + public object Clone() { return new PerkEffect(this); diff --git a/ESPSharp/Subrecords/GeneratedCode/AIData.cs b/ESPSharp/Subrecords/GeneratedCode/AIData.cs index c4387f5..d933e22 100644 --- a/ESPSharp/Subrecords/GeneratedCode/AIData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/AIData.cs @@ -213,8 +213,10 @@ public override object Clone() public int CompareTo(AIData other) { - return Aggression.CompareTo(other.Aggression); - } + int result = 0; + + return result; + } public static bool operator >(AIData objA, AIData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ActivateParent.cs b/ESPSharp/Subrecords/GeneratedCode/ActivateParent.cs index 985a56b..7f59a73 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ActivateParent.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ActivateParent.cs @@ -91,8 +91,10 @@ public override object Clone() public int CompareTo(ActivateParent other) { - return Parent.CompareTo(other.Parent); - } + int result = 0; + + return result; + } public static bool operator >(ActivateParent objA, ActivateParent objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/AddonNodeData.cs b/ESPSharp/Subrecords/GeneratedCode/AddonNodeData.cs index 084ae78..1135d8e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/AddonNodeData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/AddonNodeData.cs @@ -95,8 +95,10 @@ public override object Clone() public int CompareTo(AddonNodeData other) { - return MasterParticleSystemCap.CompareTo(other.MasterParticleSystemCap); - } + int result = 0; + + return result; + } public static bool operator >(AddonNodeData objA, AddonNodeData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/AmmoData.cs b/ESPSharp/Subrecords/GeneratedCode/AmmoData.cs index 4fb8d07..7a6e312 100644 --- a/ESPSharp/Subrecords/GeneratedCode/AmmoData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/AmmoData.cs @@ -129,8 +129,10 @@ public override object Clone() public int CompareTo(AmmoData other) { - return Speed.CompareTo(other.Speed); - } + int result = 0; + + return result; + } public static bool operator >(AmmoData objA, AmmoData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/AmmoEffectData.cs b/ESPSharp/Subrecords/GeneratedCode/AmmoEffectData.cs index 6ea8f04..75596bb 100644 --- a/ESPSharp/Subrecords/GeneratedCode/AmmoEffectData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/AmmoEffectData.cs @@ -103,8 +103,10 @@ public override object Clone() public int CompareTo(AmmoEffectData other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(AmmoEffectData objA, AmmoEffectData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/AmmoExtraData.cs b/ESPSharp/Subrecords/GeneratedCode/AmmoExtraData.cs index 88ff5a2..970b162 100644 --- a/ESPSharp/Subrecords/GeneratedCode/AmmoExtraData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/AmmoExtraData.cs @@ -129,8 +129,10 @@ public override object Clone() public int CompareTo(AmmoExtraData other) { - return Projectile.CompareTo(other.Projectile); - } + int result = 0; + + return result; + } public static bool operator >(AmmoExtraData objA, AmmoExtraData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/AnimationSound.cs b/ESPSharp/Subrecords/GeneratedCode/AnimationSound.cs index 1c5d8c0..3e7bcd1 100644 --- a/ESPSharp/Subrecords/GeneratedCode/AnimationSound.cs +++ b/ESPSharp/Subrecords/GeneratedCode/AnimationSound.cs @@ -118,8 +118,10 @@ public override object Clone() public int CompareTo(AnimationSound other) { - return Sound.CompareTo(other.Sound); - } + int result = 0; + + return result; + } public static bool operator >(AnimationSound objA, AnimationSound objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ArmorAddonData.cs b/ESPSharp/Subrecords/GeneratedCode/ArmorAddonData.cs index 5df211d..21224d7 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ArmorAddonData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ArmorAddonData.cs @@ -107,8 +107,10 @@ public override object Clone() public int CompareTo(ArmorAddonData other) { - return ArmorRating.CompareTo(other.ArmorRating); - } + int result = 0; + + return result; + } public static bool operator >(ArmorAddonData objA, ArmorAddonData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ArmorData.cs b/ESPSharp/Subrecords/GeneratedCode/ArmorData.cs index 64bfe0c..f109107 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ArmorData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ArmorData.cs @@ -103,8 +103,10 @@ public override object Clone() public int CompareTo(ArmorData other) { - return Value.CompareTo(other.Value); - } + int result = 0; + + return result; + } public static bool operator >(ArmorData objA, ArmorData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ArmorExtraData.cs b/ESPSharp/Subrecords/GeneratedCode/ArmorExtraData.cs index bc151d8..1307a56 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ArmorExtraData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ArmorExtraData.cs @@ -119,8 +119,10 @@ public override object Clone() public int CompareTo(ArmorExtraData other) { - return DamageResistance.CompareTo(other.DamageResistance); - } + int result = 0; + + return result; + } public static bool operator >(ArmorExtraData objA, ArmorExtraData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/Attributes.cs b/ESPSharp/Subrecords/GeneratedCode/Attributes.cs index 7a090f0..cdbe099 100644 --- a/ESPSharp/Subrecords/GeneratedCode/Attributes.cs +++ b/ESPSharp/Subrecords/GeneratedCode/Attributes.cs @@ -151,8 +151,10 @@ public override object Clone() public int CompareTo(Attributes other) { - return Strength.CompareTo(other.Strength); - } + int result = 0; + + return result; + } public static bool operator >(Attributes objA, Attributes objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/BillboardDimensions.cs b/ESPSharp/Subrecords/GeneratedCode/BillboardDimensions.cs index f04d016..4424407 100644 --- a/ESPSharp/Subrecords/GeneratedCode/BillboardDimensions.cs +++ b/ESPSharp/Subrecords/GeneratedCode/BillboardDimensions.cs @@ -91,8 +91,10 @@ public override object Clone() public int CompareTo(BillboardDimensions other) { - return Width.CompareTo(other.Width); - } + int result = 0; + + return result; + } public static bool operator >(BillboardDimensions objA, BillboardDimensions objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/BipedData.cs b/ESPSharp/Subrecords/GeneratedCode/BipedData.cs index 422b7b3..12fe945 100644 --- a/ESPSharp/Subrecords/GeneratedCode/BipedData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/BipedData.cs @@ -105,8 +105,10 @@ public override object Clone() public int CompareTo(BipedData other) { - return Slots.CompareTo(other.Slots); - } + int result = 0; + + return result; + } public static bool operator >(BipedData objA, BipedData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/BodyPartInfo.cs b/ESPSharp/Subrecords/GeneratedCode/BodyPartInfo.cs index ede9df9..d8ac193 100644 --- a/ESPSharp/Subrecords/GeneratedCode/BodyPartInfo.cs +++ b/ESPSharp/Subrecords/GeneratedCode/BodyPartInfo.cs @@ -411,8 +411,10 @@ public override object Clone() public int CompareTo(BodyPartInfo other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(BodyPartInfo objA, BodyPartInfo objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/BookData.cs b/ESPSharp/Subrecords/GeneratedCode/BookData.cs index c1b9053..ec48a26 100644 --- a/ESPSharp/Subrecords/GeneratedCode/BookData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/BookData.cs @@ -115,8 +115,10 @@ public override object Clone() public int CompareTo(BookData other) { - return Skill.CompareTo(other.Skill); - } + int result = 0; + + return result; + } public static bool operator >(BookData objA, BookData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/BoundHalfExtents.cs b/ESPSharp/Subrecords/GeneratedCode/BoundHalfExtents.cs index c0aeab6..d5c6ade 100644 --- a/ESPSharp/Subrecords/GeneratedCode/BoundHalfExtents.cs +++ b/ESPSharp/Subrecords/GeneratedCode/BoundHalfExtents.cs @@ -103,8 +103,10 @@ public override object Clone() public int CompareTo(BoundHalfExtents other) { - return X.CompareTo(other.X); - } + int result = 0; + + return result; + } public static bool operator >(BoundHalfExtents objA, BoundHalfExtents objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CameraShotData.cs b/ESPSharp/Subrecords/GeneratedCode/CameraShotData.cs index 01df4ba..848c7ad 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CameraShotData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CameraShotData.cs @@ -187,8 +187,10 @@ public override object Clone() public int CompareTo(CameraShotData other) { - return Action.CompareTo(other.Action); - } + int result = 0; + + return result; + } public static bool operator >(CameraShotData objA, CameraShotData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CasinoData.cs b/ESPSharp/Subrecords/GeneratedCode/CasinoData.cs index e4b8599..cecdd37 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CasinoData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CasinoData.cs @@ -237,8 +237,10 @@ public override object Clone() public int CompareTo(CasinoData other) { - return WinningsQuest.CompareTo(other.WinningsQuest); - } + int result = 0; + + return result; + } public static bool operator >(CasinoData objA, CasinoData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CellGrid.cs b/ESPSharp/Subrecords/GeneratedCode/CellGrid.cs index a28567b..edfe51a 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CellGrid.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CellGrid.cs @@ -103,8 +103,10 @@ public override object Clone() public int CompareTo(CellGrid other) { - return X.CompareTo(other.X); - } + int result = 0; + + return result; + } public static bool operator >(CellGrid objA, CellGrid objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CellLighting.cs b/ESPSharp/Subrecords/GeneratedCode/CellLighting.cs index 7b24425..3b5c323 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CellLighting.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CellLighting.cs @@ -190,8 +190,10 @@ public override object Clone() public int CompareTo(CellLighting other) { - return ColorAmbient.CompareTo(other.ColorAmbient); - } + int result = 0; + + return result; + } public static bool operator >(CellLighting objA, CellLighting objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ClassData.cs b/ESPSharp/Subrecords/GeneratedCode/ClassData.cs index f47da83..981f95c 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ClassData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ClassData.cs @@ -177,8 +177,10 @@ public override object Clone() public int CompareTo(ClassData other) { - return TagSkill1.CompareTo(other.TagSkill1); - } + int result = 0; + + return result; + } public static bool operator >(ClassData objA, ClassData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ClimateTiming.cs b/ESPSharp/Subrecords/GeneratedCode/ClimateTiming.cs index 564f79f..b5685aa 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ClimateTiming.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ClimateTiming.cs @@ -140,8 +140,10 @@ public override object Clone() public int CompareTo(ClimateTiming other) { - return SunriseBegin.CompareTo(other.SunriseBegin); - } + int result = 0; + + return result; + } public static bool operator >(ClimateTiming objA, ClimateTiming objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CloudLayerColors.cs b/ESPSharp/Subrecords/GeneratedCode/CloudLayerColors.cs index 586e7f3..af25eeb 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CloudLayerColors.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CloudLayerColors.cs @@ -119,8 +119,10 @@ public override object Clone() public int CompareTo(CloudLayerColors other) { - return Layer0.CompareTo(other.Layer0); - } + int result = 0; + + return result; + } public static bool operator >(CloudLayerColors objA, CloudLayerColors objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CloudLayerSpeed.cs b/ESPSharp/Subrecords/GeneratedCode/CloudLayerSpeed.cs index 5985cc5..d822bd5 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CloudLayerSpeed.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CloudLayerSpeed.cs @@ -115,8 +115,10 @@ public override object Clone() public int CompareTo(CloudLayerSpeed other) { - return Layer0.CompareTo(other.Layer0); - } + int result = 0; + + return result; + } public static bool operator >(CloudLayerSpeed objA, CloudLayerSpeed objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CombatStyleAdvanced.cs b/ESPSharp/Subrecords/GeneratedCode/CombatStyleAdvanced.cs index 8090473..a289638 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CombatStyleAdvanced.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CombatStyleAdvanced.cs @@ -319,8 +319,10 @@ public override object Clone() public int CompareTo(CombatStyleAdvanced other) { - return DodgeFatigueModMult.CompareTo(other.DodgeFatigueModMult); - } + int result = 0; + + return result; + } public static bool operator >(CombatStyleAdvanced objA, CombatStyleAdvanced objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CombatStyleDecision.cs b/ESPSharp/Subrecords/GeneratedCode/CombatStyleDecision.cs index fc2d205..8427d64 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CombatStyleDecision.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CombatStyleDecision.cs @@ -485,8 +485,10 @@ public override object Clone() public int CompareTo(CombatStyleDecision other) { - return ManeuverDodgeChance.CompareTo(other.ManeuverDodgeChance); - } + int result = 0; + + return result; + } public static bool operator >(CombatStyleDecision objA, CombatStyleDecision objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CombatStyleSimple.cs b/ESPSharp/Subrecords/GeneratedCode/CombatStyleSimple.cs index 1aceee1..eadc5d2 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CombatStyleSimple.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CombatStyleSimple.cs @@ -261,8 +261,10 @@ public override object Clone() public int CompareTo(CombatStyleSimple other) { - return CoverSearchRadius.CompareTo(other.CoverSearchRadius); - } + int result = 0; + + return result; + } public static bool operator >(CombatStyleSimple objA, CombatStyleSimple objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/Condition.cs b/ESPSharp/Subrecords/GeneratedCode/Condition.cs index 66ce117..b8fdf5a 100644 --- a/ESPSharp/Subrecords/GeneratedCode/Condition.cs +++ b/ESPSharp/Subrecords/GeneratedCode/Condition.cs @@ -118,8 +118,10 @@ public override object Clone() public int CompareTo(Condition other) { - return Function.CompareTo(other.Function); - } + int result = 0; + + return result; + } public static bool operator >(Condition objA, Condition objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ContainerData.cs b/ESPSharp/Subrecords/GeneratedCode/ContainerData.cs index 84080dd..8f1e079 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ContainerData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ContainerData.cs @@ -91,8 +91,10 @@ public override object Clone() public int CompareTo(ContainerData other) { - return Flags.CompareTo(other.Flags); - } + int result = 0; + + return result; + } public static bool operator >(ContainerData objA, ContainerData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CreatureBaseStats.cs b/ESPSharp/Subrecords/GeneratedCode/CreatureBaseStats.cs index b955c13..2022033 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CreatureBaseStats.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CreatureBaseStats.cs @@ -187,8 +187,10 @@ public override object Clone() public int CompareTo(CreatureBaseStats other) { - return Level.CompareTo(other.Level); - } + int result = 0; + + return result; + } public static bool operator >(CreatureBaseStats objA, CreatureBaseStats objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/CreatureData.cs b/ESPSharp/Subrecords/GeneratedCode/CreatureData.cs index 8a6efd9..1e35ee8 100644 --- a/ESPSharp/Subrecords/GeneratedCode/CreatureData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/CreatureData.cs @@ -237,8 +237,10 @@ public override object Clone() public int CompareTo(CreatureData other) { - return CreatureType.CompareTo(other.CreatureType); - } + int result = 0; + + return result; + } public static bool operator >(CreatureData objA, CreatureData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/DebrisData.cs b/ESPSharp/Subrecords/GeneratedCode/DebrisData.cs index 13f5e37..fd5d37a 100644 --- a/ESPSharp/Subrecords/GeneratedCode/DebrisData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/DebrisData.cs @@ -104,8 +104,10 @@ public override object Clone() public int CompareTo(DebrisData other) { - return Percentage.CompareTo(other.Percentage); - } + int result = 0; + + return result; + } public static bool operator >(DebrisData objA, DebrisData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/DecalData.cs b/ESPSharp/Subrecords/GeneratedCode/DecalData.cs index fcf4099..fd92cf1 100644 --- a/ESPSharp/Subrecords/GeneratedCode/DecalData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/DecalData.cs @@ -202,8 +202,10 @@ public override object Clone() public int CompareTo(DecalData other) { - return Depth.CompareTo(other.Depth); - } + int result = 0; + + return result; + } public static bool operator >(DecalData objA, DecalData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/DefaultObjects.cs b/ESPSharp/Subrecords/GeneratedCode/DefaultObjects.cs index 0f2b0b7..37b75b4 100644 --- a/ESPSharp/Subrecords/GeneratedCode/DefaultObjects.cs +++ b/ESPSharp/Subrecords/GeneratedCode/DefaultObjects.cs @@ -509,8 +509,10 @@ public override object Clone() public int CompareTo(DefaultObjects other) { - return Stimpack.CompareTo(other.Stimpack); - } + int result = 0; + + return result; + } public static bool operator >(DefaultObjects objA, DefaultObjects objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/DestructableHeader.cs b/ESPSharp/Subrecords/GeneratedCode/DestructableHeader.cs index 5ef3f5c..5a2489d 100644 --- a/ESPSharp/Subrecords/GeneratedCode/DestructableHeader.cs +++ b/ESPSharp/Subrecords/GeneratedCode/DestructableHeader.cs @@ -119,8 +119,10 @@ public override object Clone() public int CompareTo(DestructableHeader other) { - return Health.CompareTo(other.Health); - } + int result = 0; + + return result; + } public static bool operator >(DestructableHeader objA, DestructableHeader objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/DestructionStageData.cs b/ESPSharp/Subrecords/GeneratedCode/DestructionStageData.cs index 3996f3b..73246a3 100644 --- a/ESPSharp/Subrecords/GeneratedCode/DestructionStageData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/DestructionStageData.cs @@ -165,8 +165,10 @@ public override object Clone() public int CompareTo(DestructionStageData other) { - return HealthPercentage.CompareTo(other.HealthPercentage); - } + int result = 0; + + return result; + } public static bool operator >(DestructionStageData objA, DestructionStageData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/DialogResponseData.cs b/ESPSharp/Subrecords/GeneratedCode/DialogResponseData.cs index 88d7e52..bf27a0f 100644 --- a/ESPSharp/Subrecords/GeneratedCode/DialogResponseData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/DialogResponseData.cs @@ -103,8 +103,10 @@ public override object Clone() public int CompareTo(DialogResponseData other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(DialogResponseData objA, DialogResponseData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/DialogTopicData.cs b/ESPSharp/Subrecords/GeneratedCode/DialogTopicData.cs index c958e1c..f6d3c7b 100644 --- a/ESPSharp/Subrecords/GeneratedCode/DialogTopicData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/DialogTopicData.cs @@ -91,8 +91,10 @@ public override object Clone() public int CompareTo(DialogTopicData other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(DialogTopicData objA, DialogTopicData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/EffectData.cs b/ESPSharp/Subrecords/GeneratedCode/EffectData.cs index 5ec8047..647f5cd 100644 --- a/ESPSharp/Subrecords/GeneratedCode/EffectData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/EffectData.cs @@ -127,8 +127,10 @@ public override object Clone() public int CompareTo(EffectData other) { - return Magnitude.CompareTo(other.Magnitude); - } + int result = 0; + + return result; + } public static bool operator >(EffectData objA, EffectData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/EffectShaderData.cs b/ESPSharp/Subrecords/GeneratedCode/EffectShaderData.cs index c9c3b97..e597096 100644 --- a/ESPSharp/Subrecords/GeneratedCode/EffectShaderData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/EffectShaderData.cs @@ -1012,8 +1012,10 @@ public override object Clone() public int CompareTo(EffectShaderData other) { - return MembraneShaderSourceBlendMode.CompareTo(other.MembraneShaderSourceBlendMode); - } + int result = 0; + + return result; + } public static bool operator >(EffectShaderData objA, EffectShaderData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/EnableParent.cs b/ESPSharp/Subrecords/GeneratedCode/EnableParent.cs index 6c1be8d..1b64864 100644 --- a/ESPSharp/Subrecords/GeneratedCode/EnableParent.cs +++ b/ESPSharp/Subrecords/GeneratedCode/EnableParent.cs @@ -106,8 +106,10 @@ public override object Clone() public int CompareTo(EnableParent other) { - return Parent.CompareTo(other.Parent); - } + int result = 0; + + return result; + } public static bool operator >(EnableParent objA, EnableParent objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/EnchantData.cs b/ESPSharp/Subrecords/GeneratedCode/EnchantData.cs index 592ce04..f142989 100644 --- a/ESPSharp/Subrecords/GeneratedCode/EnchantData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/EnchantData.cs @@ -133,8 +133,10 @@ public override object Clone() public int CompareTo(EnchantData other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(EnchantData objA, EnchantData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/EncounterZoneData.cs b/ESPSharp/Subrecords/GeneratedCode/EncounterZoneData.cs index 0387dbf..7bdcb46 100644 --- a/ESPSharp/Subrecords/GeneratedCode/EncounterZoneData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/EncounterZoneData.cs @@ -126,8 +126,10 @@ public override object Clone() public int CompareTo(EncounterZoneData other) { - return MinimumLevel.CompareTo(other.MinimumLevel); - } + int result = 0; + + return result; + } public static bool operator >(EncounterZoneData objA, EncounterZoneData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/EntryPointActorValMult.cs b/ESPSharp/Subrecords/GeneratedCode/EntryPointActorValMult.cs index e7ee396..71de0da 100644 --- a/ESPSharp/Subrecords/GeneratedCode/EntryPointActorValMult.cs +++ b/ESPSharp/Subrecords/GeneratedCode/EntryPointActorValMult.cs @@ -91,8 +91,10 @@ public override object Clone() public int CompareTo(EntryPointActorValMult other) { - return ActorValue.CompareTo(other.ActorValue); - } + int result = 0; + + return result; + } public static bool operator >(EntryPointActorValMult objA, EntryPointActorValMult objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/EntryPointRandRange.cs b/ESPSharp/Subrecords/GeneratedCode/EntryPointRandRange.cs index cb3525d..a371f52 100644 --- a/ESPSharp/Subrecords/GeneratedCode/EntryPointRandRange.cs +++ b/ESPSharp/Subrecords/GeneratedCode/EntryPointRandRange.cs @@ -91,8 +91,10 @@ public override object Clone() public int CompareTo(EntryPointRandRange other) { - return RandMin.CompareTo(other.RandMin); - } + int result = 0; + + return result; + } public static bool operator >(EntryPointRandRange objA, EntryPointRandRange objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/EnvironmentalColors.cs b/ESPSharp/Subrecords/GeneratedCode/EnvironmentalColors.cs index 268fff5..bf2d2ac 100644 --- a/ESPSharp/Subrecords/GeneratedCode/EnvironmentalColors.cs +++ b/ESPSharp/Subrecords/GeneratedCode/EnvironmentalColors.cs @@ -197,8 +197,10 @@ public override object Clone() public int CompareTo(EnvironmentalColors other) { - return Ambient.CompareTo(other.Ambient); - } + int result = 0; + + return result; + } public static bool operator >(EnvironmentalColors objA, EnvironmentalColors objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ExplosionData.cs b/ESPSharp/Subrecords/GeneratedCode/ExplosionData.cs index 7dfe83a..5d8ed5a 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ExplosionData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ExplosionData.cs @@ -227,8 +227,10 @@ public override object Clone() public int CompareTo(ExplosionData other) { - return Damage.CompareTo(other.Damage); - } + int result = 0; + + return result; + } public static bool operator >(ExplosionData objA, ExplosionData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/FactionData.cs b/ESPSharp/Subrecords/GeneratedCode/FactionData.cs index 629e993..5c08cef 100644 --- a/ESPSharp/Subrecords/GeneratedCode/FactionData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/FactionData.cs @@ -105,8 +105,10 @@ public override object Clone() public int CompareTo(FactionData other) { - return Flags1.CompareTo(other.Flags1); - } + int result = 0; + + return result; + } public static bool operator >(FactionData objA, FactionData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/FactionMembership.cs b/ESPSharp/Subrecords/GeneratedCode/FactionMembership.cs index b545f9a..a5ee54e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/FactionMembership.cs +++ b/ESPSharp/Subrecords/GeneratedCode/FactionMembership.cs @@ -106,8 +106,16 @@ public override object Clone() public int CompareTo(FactionMembership other) { - return Faction.CompareTo(other.Faction); - } + int result = 0; + + if (result == 0 && Faction != null && other.Faction != null) + result = Faction.CompareTo(other.Faction); + + if (result == 0 && Rank != null && other.Rank != null) + result = Rank.CompareTo(other.Rank); + + return result; + } public static bool operator >(FactionMembership objA, FactionMembership objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/FactionMembership.tt b/ESPSharp/Subrecords/GeneratedCode/FactionMembership.tt index 6ae0387..b7d680a 100644 --- a/ESPSharp/Subrecords/GeneratedCode/FactionMembership.tt +++ b/ESPSharp/Subrecords/GeneratedCode/FactionMembership.tt @@ -12,6 +12,7 @@ "Faction", "Faction" ); + tempField.sortIndex = 0; template.hashKey = tempField; template.Fields.Add(tempField); @@ -21,6 +22,7 @@ "Rank", "Rank" ); + tempField.sortIndex = 1; template.Fields.Add(tempField); tempField = diff --git a/ESPSharp/Subrecords/GeneratedCode/FootstepMaterial.cs b/ESPSharp/Subrecords/GeneratedCode/FootstepMaterial.cs index 5732009..517b9f6 100644 --- a/ESPSharp/Subrecords/GeneratedCode/FootstepMaterial.cs +++ b/ESPSharp/Subrecords/GeneratedCode/FootstepMaterial.cs @@ -227,8 +227,10 @@ public override object Clone() public int CompareTo(FootstepMaterial other) { - return ConcreteSolid.GetHashCode().CompareTo(other.ConcreteSolid.GetHashCode()); - } + int result = 0; + + return result; + } public static bool operator >(FootstepMaterial objA, FootstepMaterial objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/GrassData.cs b/ESPSharp/Subrecords/GeneratedCode/GrassData.cs index 8084a1c..b8fca6e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/GrassData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/GrassData.cs @@ -225,8 +225,10 @@ public override object Clone() public int CompareTo(GrassData other) { - return Density.CompareTo(other.Density); - } + int result = 0; + + return result; + } public static bool operator >(GrassData objA, GrassData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/HavokData.cs b/ESPSharp/Subrecords/GeneratedCode/HavokData.cs index c197477..1161f2d 100644 --- a/ESPSharp/Subrecords/GeneratedCode/HavokData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/HavokData.cs @@ -103,8 +103,10 @@ public override object Clone() public int CompareTo(HavokData other) { - return MaterialType.CompareTo(other.MaterialType); - } + int result = 0; + + return result; + } public static bool operator >(HavokData objA, HavokData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/IdleAnimationData.cs b/ESPSharp/Subrecords/GeneratedCode/IdleAnimationData.cs index 641510d..5c43d0e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/IdleAnimationData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/IdleAnimationData.cs @@ -147,8 +147,10 @@ public override object Clone() public int CompareTo(IdleAnimationData other) { - return AnimationGroupSection.CompareTo(other.AnimationGroupSection); - } + int result = 0; + + return result; + } public static bool operator >(IdleAnimationData objA, IdleAnimationData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ImageSpaceAdapterData.cs b/ESPSharp/Subrecords/GeneratedCode/ImageSpaceAdapterData.cs index 466f286..2b7c066 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ImageSpaceAdapterData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ImageSpaceAdapterData.cs @@ -593,8 +593,10 @@ public override object Clone() public int CompareTo(ImageSpaceAdapterData other) { - return Duration.CompareTo(other.Duration); - } + int result = 0; + + return result; + } public static bool operator >(ImageSpaceAdapterData objA, ImageSpaceAdapterData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ImageSpaceData.cs b/ESPSharp/Subrecords/GeneratedCode/ImageSpaceData.cs index 494828a..dd98dd8 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ImageSpaceData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ImageSpaceData.cs @@ -483,8 +483,10 @@ public override object Clone() public int CompareTo(ImageSpaceData other) { - return Brightness.CompareTo(other.Brightness); - } + int result = 0; + + return result; + } public static bool operator >(ImageSpaceData objA, ImageSpaceData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ImpactData.cs b/ESPSharp/Subrecords/GeneratedCode/ImpactData.cs index 22dfe0e..0aa16a2 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ImpactData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ImpactData.cs @@ -139,8 +139,10 @@ public override object Clone() public int CompareTo(ImpactData other) { - return EffectDuration.CompareTo(other.EffectDuration); - } + int result = 0; + + return result; + } public static bool operator >(ImpactData objA, ImpactData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ImpactList.cs b/ESPSharp/Subrecords/GeneratedCode/ImpactList.cs index e4b7001..7ec82e4 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ImpactList.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ImpactList.cs @@ -223,8 +223,10 @@ public override object Clone() public int CompareTo(ImpactList other) { - return Stone.CompareTo(other.Stone); - } + int result = 0; + + return result; + } public static bool operator >(ImpactList objA, ImpactList objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/IngestibleData.cs b/ESPSharp/Subrecords/GeneratedCode/IngestibleData.cs index aac1755..c583ef4 100644 --- a/ESPSharp/Subrecords/GeneratedCode/IngestibleData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/IngestibleData.cs @@ -143,8 +143,10 @@ public override object Clone() public int CompareTo(IngestibleData other) { - return WithdrawalEffect.CompareTo(other.WithdrawalEffect); - } + int result = 0; + + return result; + } public static bool operator >(IngestibleData objA, IngestibleData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/IngredientData.cs b/ESPSharp/Subrecords/GeneratedCode/IngredientData.cs index af8e4bd..675212b 100644 --- a/ESPSharp/Subrecords/GeneratedCode/IngredientData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/IngredientData.cs @@ -105,8 +105,10 @@ public override object Clone() public int CompareTo(IngredientData other) { - return Value.CompareTo(other.Value); - } + int result = 0; + + return result; + } public static bool operator >(IngredientData objA, IngredientData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/InventoryItemData.cs b/ESPSharp/Subrecords/GeneratedCode/InventoryItemData.cs index f393299..b503be7 100644 --- a/ESPSharp/Subrecords/GeneratedCode/InventoryItemData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/InventoryItemData.cs @@ -92,8 +92,16 @@ public override object Clone() public int CompareTo(InventoryItemData other) { - return Item.CompareTo(other.Item); - } + int result = 0; + + if (result == 0 && Item != null && other.Item != null) + result = Item.CompareTo(other.Item); + + if (result == 0 && Count != null && other.Count != null) + result = Count.CompareTo(other.Count); + + return result; + } public static bool operator >(InventoryItemData objA, InventoryItemData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/InventoryItemData.tt b/ESPSharp/Subrecords/GeneratedCode/InventoryItemData.tt index 3928540..ac654d9 100644 --- a/ESPSharp/Subrecords/GeneratedCode/InventoryItemData.tt +++ b/ESPSharp/Subrecords/GeneratedCode/InventoryItemData.tt @@ -13,6 +13,7 @@ "Item" ); template.hashKey = tempField; + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = @@ -22,5 +23,6 @@ "Count" ); template.Fields.Add(tempField); + tempField.sortIndex = 1; #> <#@ include file="SubrecordTemplate.t4" once="true" #> \ No newline at end of file diff --git a/ESPSharp/Subrecords/GeneratedCode/InventoryItemExtraData.cs b/ESPSharp/Subrecords/GeneratedCode/InventoryItemExtraData.cs index a12357c..6578c58 100644 --- a/ESPSharp/Subrecords/GeneratedCode/InventoryItemExtraData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/InventoryItemExtraData.cs @@ -102,8 +102,10 @@ public override object Clone() public int CompareTo(InventoryItemExtraData other) { - return Owner.CompareTo(other.Owner); - } + int result = 0; + + return result; + } public static bool operator >(InventoryItemExtraData objA, InventoryItemExtraData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/LeveledObjectData.cs b/ESPSharp/Subrecords/GeneratedCode/LeveledObjectData.cs index b32c79c..b4bf740 100644 --- a/ESPSharp/Subrecords/GeneratedCode/LeveledObjectData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/LeveledObjectData.cs @@ -132,8 +132,10 @@ public override object Clone() public int CompareTo(LeveledObjectData other) { - return Level.CompareTo(other.Level); - } + int result = 0; + + return result; + } public static bool operator >(LeveledObjectData objA, LeveledObjectData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/LightData.cs b/ESPSharp/Subrecords/GeneratedCode/LightData.cs index a13a3cf..4d8be42 100644 --- a/ESPSharp/Subrecords/GeneratedCode/LightData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/LightData.cs @@ -164,8 +164,10 @@ public override object Clone() public int CompareTo(LightData other) { - return Radius.CompareTo(other.Radius); - } + int result = 0; + + return result; + } public static bool operator >(LightData objA, LightData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/LightingTemplateData.cs b/ESPSharp/Subrecords/GeneratedCode/LightingTemplateData.cs index 511d186..0bb8096 100644 --- a/ESPSharp/Subrecords/GeneratedCode/LightingTemplateData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/LightingTemplateData.cs @@ -190,8 +190,10 @@ public override object Clone() public int CompareTo(LightingTemplateData other) { - return ColorAmbient.CompareTo(other.ColorAmbient); - } + int result = 0; + + return result; + } public static bool operator >(LightingTemplateData objA, LightingTemplateData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/LinkedOcclusionPlanes.cs b/ESPSharp/Subrecords/GeneratedCode/LinkedOcclusionPlanes.cs index b6b5403..4f62753 100644 --- a/ESPSharp/Subrecords/GeneratedCode/LinkedOcclusionPlanes.cs +++ b/ESPSharp/Subrecords/GeneratedCode/LinkedOcclusionPlanes.cs @@ -119,8 +119,10 @@ public override object Clone() public int CompareTo(LinkedOcclusionPlanes other) { - return Right.CompareTo(other.Right); - } + int result = 0; + + return result; + } public static bool operator >(LinkedOcclusionPlanes objA, LinkedOcclusionPlanes objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/LinkedReferenceColor.cs b/ESPSharp/Subrecords/GeneratedCode/LinkedReferenceColor.cs index d341379..d4091b8 100644 --- a/ESPSharp/Subrecords/GeneratedCode/LinkedReferenceColor.cs +++ b/ESPSharp/Subrecords/GeneratedCode/LinkedReferenceColor.cs @@ -93,8 +93,10 @@ public override object Clone() public int CompareTo(LinkedReferenceColor other) { - return Start.CompareTo(other.Start); - } + int result = 0; + + return result; + } public static bool operator >(LinkedReferenceColor objA, LinkedReferenceColor objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/LoadScreenLocation.cs b/ESPSharp/Subrecords/GeneratedCode/LoadScreenLocation.cs index ed693a9..9c63bf9 100644 --- a/ESPSharp/Subrecords/GeneratedCode/LoadScreenLocation.cs +++ b/ESPSharp/Subrecords/GeneratedCode/LoadScreenLocation.cs @@ -117,8 +117,10 @@ public override object Clone() public int CompareTo(LoadScreenLocation other) { - return Direct.CompareTo(other.Direct); - } + int result = 0; + + return result; + } public static bool operator >(LoadScreenLocation objA, LoadScreenLocation objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/LoadScreenTypeData.cs b/ESPSharp/Subrecords/GeneratedCode/LoadScreenTypeData.cs index 8f7e8ea..72ffad9 100644 --- a/ESPSharp/Subrecords/GeneratedCode/LoadScreenTypeData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/LoadScreenTypeData.cs @@ -291,8 +291,10 @@ public override object Clone() public int CompareTo(LoadScreenTypeData other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(LoadScreenTypeData objA, LoadScreenTypeData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/LocalVariableData.cs b/ESPSharp/Subrecords/GeneratedCode/LocalVariableData.cs index 124e35f..573886c 100644 --- a/ESPSharp/Subrecords/GeneratedCode/LocalVariableData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/LocalVariableData.cs @@ -119,8 +119,10 @@ public override object Clone() public int CompareTo(LocalVariableData other) { - return Index.CompareTo(other.Index); - } + int result = 0; + + return result; + } public static bool operator >(LocalVariableData objA, LocalVariableData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/LockData.cs b/ESPSharp/Subrecords/GeneratedCode/LockData.cs index 9a8d694..9cc54c9 100644 --- a/ESPSharp/Subrecords/GeneratedCode/LockData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/LockData.cs @@ -132,8 +132,10 @@ public override object Clone() public int CompareTo(LockData other) { - return Level.CompareTo(other.Level); - } + int result = 0; + + return result; + } public static bool operator >(LockData objA, LockData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/MagicEffectData.cs b/ESPSharp/Subrecords/GeneratedCode/MagicEffectData.cs index 42f3476..aa638a9 100644 --- a/ESPSharp/Subrecords/GeneratedCode/MagicEffectData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/MagicEffectData.cs @@ -305,8 +305,10 @@ public override object Clone() public int CompareTo(MagicEffectData other) { - return AssociatedItem.CompareTo(other.AssociatedItem); - } + int result = 0; + + return result; + } public static bool operator >(MagicEffectData objA, MagicEffectData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/MapData.cs b/ESPSharp/Subrecords/GeneratedCode/MapData.cs index 711290b..ae4c021 100644 --- a/ESPSharp/Subrecords/GeneratedCode/MapData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/MapData.cs @@ -139,8 +139,10 @@ public override object Clone() public int CompareTo(MapData other) { - return UsableXSize.CompareTo(other.UsableXSize); - } + int result = 0; + + return result; + } public static bool operator >(MapData objA, MapData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/MapMarkerData.cs b/ESPSharp/Subrecords/GeneratedCode/MapMarkerData.cs index 46bba07..ed62ab1 100644 --- a/ESPSharp/Subrecords/GeneratedCode/MapMarkerData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/MapMarkerData.cs @@ -93,8 +93,10 @@ public override object Clone() public int CompareTo(MapMarkerData other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(MapMarkerData objA, MapMarkerData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/NPCBaseStats.cs b/ESPSharp/Subrecords/GeneratedCode/NPCBaseStats.cs index e99ef7b..c01b912 100644 --- a/ESPSharp/Subrecords/GeneratedCode/NPCBaseStats.cs +++ b/ESPSharp/Subrecords/GeneratedCode/NPCBaseStats.cs @@ -187,8 +187,10 @@ public override object Clone() public int CompareTo(NPCBaseStats other) { - return Level.CompareTo(other.Level); - } + int result = 0; + + return result; + } public static bool operator >(NPCBaseStats objA, NPCBaseStats objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/NPCData.cs b/ESPSharp/Subrecords/GeneratedCode/NPCData.cs index 3416dd4..dc2898c 100644 --- a/ESPSharp/Subrecords/GeneratedCode/NPCData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/NPCData.cs @@ -163,8 +163,10 @@ public override object Clone() public int CompareTo(NPCData other) { - return BaseHealth.CompareTo(other.BaseHealth); - } + int result = 0; + + return result; + } public static bool operator >(NPCData objA, NPCData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/NPCSkills.cs b/ESPSharp/Subrecords/GeneratedCode/NPCSkills.cs index cb16d68..732430e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/NPCSkills.cs +++ b/ESPSharp/Subrecords/GeneratedCode/NPCSkills.cs @@ -403,8 +403,10 @@ public override object Clone() public int CompareTo(NPCSkills other) { - return BarterValue.CompareTo(other.BarterValue); - } + int result = 0; + + return result; + } public static bool operator >(NPCSkills objA, NPCSkills objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/NavMeshData.cs b/ESPSharp/Subrecords/GeneratedCode/NavMeshData.cs index d7032f7..25bef61 100644 --- a/ESPSharp/Subrecords/GeneratedCode/NavMeshData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/NavMeshData.cs @@ -140,8 +140,10 @@ public override object Clone() public int CompareTo(NavMeshData other) { - return Cell.CompareTo(other.Cell); - } + int result = 0; + + return result; + } public static bool operator >(NavMeshData objA, NavMeshData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/NavigationConnectionInfo.cs b/ESPSharp/Subrecords/GeneratedCode/NavigationConnectionInfo.cs index 85add0c..53d002a 100644 --- a/ESPSharp/Subrecords/GeneratedCode/NavigationConnectionInfo.cs +++ b/ESPSharp/Subrecords/GeneratedCode/NavigationConnectionInfo.cs @@ -184,8 +184,10 @@ public override object Clone() public int CompareTo(NavigationConnectionInfo other) { - return Unknown1.CompareTo(other.Unknown1); - } + int result = 0; + + return result; + } public static bool operator >(NavigationConnectionInfo objA, NavigationConnectionInfo objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/NavigationDoorLink.cs b/ESPSharp/Subrecords/GeneratedCode/NavigationDoorLink.cs index 8159db5..06ef27d 100644 --- a/ESPSharp/Subrecords/GeneratedCode/NavigationDoorLink.cs +++ b/ESPSharp/Subrecords/GeneratedCode/NavigationDoorLink.cs @@ -18,16 +18,16 @@ namespace ESPSharp.Subrecords public partial class NavigationDoorLink : Subrecord, ICloneable, IComparable, IEquatable { public FormID NavigationMesh { get; set; } - public Byte[] Unknown { get; set; } + public UInt32 Unknown { get; set; } public NavigationDoorLink(string Tag = null) :base(Tag) { NavigationMesh = new FormID(); - Unknown = new byte[4]; + Unknown = new UInt32(); } - public NavigationDoorLink(FormID NavigationMesh, Byte[] Unknown) + public NavigationDoorLink(FormID NavigationMesh, UInt32 Unknown) { this.NavigationMesh = NavigationMesh; this.Unknown = Unknown; @@ -37,8 +37,7 @@ public NavigationDoorLink(NavigationDoorLink copyObject) { if (copyObject.NavigationMesh != null) NavigationMesh = (FormID)copyObject.NavigationMesh.Clone(); - if (copyObject.Unknown != null) - Unknown = (Byte[])copyObject.Unknown.Clone(); + Unknown = copyObject.Unknown; } protected override void ReadData(ESPReader reader) @@ -49,7 +48,7 @@ protected override void ReadData(ESPReader reader) try { NavigationMesh.ReadBinary(subReader); - Unknown = subReader.ReadBytes(4); + Unknown = subReader.ReadUInt32(); } catch { @@ -61,9 +60,6 @@ protected override void ReadData(ESPReader reader) protected override void WriteData(ESPWriter writer) { NavigationMesh.WriteBinary(writer); - if (Unknown == null) - writer.Write(new byte[4]); - else writer.Write(Unknown); } @@ -74,7 +70,8 @@ protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) ele.TryPathTo("NavigationMesh", true, out subEle); NavigationMesh.WriteXML(subEle, master); - WriteUnknownXML(ele, master); + ele.TryPathTo("Unknown", true, out subEle); + subEle.Value = Unknown.ToString(); } protected override void ReadDataXML(XElement ele, ElderScrollsPlugin master) @@ -84,7 +81,8 @@ protected override void ReadDataXML(XElement ele, ElderScrollsPlugin master) if (ele.TryPathTo("NavigationMesh", false, out subEle)) NavigationMesh.ReadXML(subEle, master); - ReadUnknownXML(ele, master); + if (ele.TryPathTo("Unknown", false, out subEle)) + Unknown = subEle.ToUInt32(); } public override object Clone() @@ -94,8 +92,10 @@ public override object Clone() public int CompareTo(NavigationDoorLink other) { - return NavigationMesh.CompareTo(other.NavigationMesh); - } + int result = 0; + + return result; + } public static bool operator >(NavigationDoorLink objA, NavigationDoorLink objB) { @@ -130,7 +130,7 @@ public bool Equals(NavigationDoorLink other) } return NavigationMesh == other.NavigationMesh && - Unknown.SequenceEqual(other.Unknown); + Unknown == other.Unknown; } public override bool Equals(object obj) @@ -180,9 +180,5 @@ public override int GetHashCode() return !objA.Equals(objB); } - - partial void ReadUnknownXML(XElement ele, ElderScrollsPlugin master); - - partial void WriteUnknownXML(XElement ele, ElderScrollsPlugin master); } } \ No newline at end of file diff --git a/ESPSharp/Subrecords/GeneratedCode/NavigationDoorLink.tt b/ESPSharp/Subrecords/GeneratedCode/NavigationDoorLink.tt index e440bd9..2dd8c8e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/NavigationDoorLink.tt +++ b/ESPSharp/Subrecords/GeneratedCode/NavigationDoorLink.tt @@ -17,13 +17,10 @@ tempField = new ClassField( - typeof(byte[]), + typeof(uint), "Unknown", "Unknown" ); - tempField.byteCount = 4; - tempField.implementReadXML = false; - tempField.implementWriteXML = false; template.Fields.Add(tempField); #> <#@ include file="SubrecordTemplate.t4" once="true" #> \ No newline at end of file diff --git a/ESPSharp/Subrecords/GeneratedCode/NavigationMapInfo.cs b/ESPSharp/Subrecords/GeneratedCode/NavigationMapInfo.cs index 3840154..c5088c0 100644 --- a/ESPSharp/Subrecords/GeneratedCode/NavigationMapInfo.cs +++ b/ESPSharp/Subrecords/GeneratedCode/NavigationMapInfo.cs @@ -149,8 +149,10 @@ public override object Clone() public int CompareTo(NavigationMapInfo other) { - return NavigationMesh.CompareTo(other.NavigationMesh); - } + int result = 0; + + return result; + } public static bool operator >(NavigationMapInfo objA, NavigationMapInfo objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ObjectBounds.cs b/ESPSharp/Subrecords/GeneratedCode/ObjectBounds.cs index 4321a57..12ae99e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ObjectBounds.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ObjectBounds.cs @@ -139,8 +139,10 @@ public override object Clone() public int CompareTo(ObjectBounds other) { - return X1.CompareTo(other.X1); - } + int result = 0; + + return result; + } public static bool operator >(ObjectBounds objA, ObjectBounds objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PackageData.cs b/ESPSharp/Subrecords/GeneratedCode/PackageData.cs index fa5fd20..b001689 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PackageData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PackageData.cs @@ -140,8 +140,10 @@ public override object Clone() public int CompareTo(PackageData other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(PackageData objA, PackageData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PackageDialogData.cs b/ESPSharp/Subrecords/GeneratedCode/PackageDialogData.cs index ddc97a7..c19de85 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PackageDialogData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PackageDialogData.cs @@ -130,8 +130,10 @@ public override object Clone() public int CompareTo(PackageDialogData other) { - return Topic.CompareTo(other.Topic); - } + int result = 0; + + return result; + } public static bool operator >(PackageDialogData objA, PackageDialogData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PackageScheduleData.cs b/ESPSharp/Subrecords/GeneratedCode/PackageScheduleData.cs index 74cbe30..c4e71cb 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PackageScheduleData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PackageScheduleData.cs @@ -127,8 +127,10 @@ public override object Clone() public int CompareTo(PackageScheduleData other) { - return DayOfWeek.CompareTo(other.DayOfWeek); - } + int result = 0; + + return result; + } public static bool operator >(PackageScheduleData objA, PackageScheduleData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PackageUseWeaponData.cs b/ESPSharp/Subrecords/GeneratedCode/PackageUseWeaponData.cs index 95ed063..bdb57de 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PackageUseWeaponData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PackageUseWeaponData.cs @@ -177,8 +177,10 @@ public override object Clone() public int CompareTo(PackageUseWeaponData other) { - return FireCount.CompareTo(other.FireCount); - } + int result = 0; + + return result; + } public static bool operator >(PackageUseWeaponData objA, PackageUseWeaponData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PerkAbilityData.cs b/ESPSharp/Subrecords/GeneratedCode/PerkAbilityData.cs index a73e7ae..199113e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PerkAbilityData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PerkAbilityData.cs @@ -80,8 +80,10 @@ public override object Clone() public int CompareTo(PerkAbilityData other) { - return Ability.CompareTo(other.Ability); - } + int result = 0; + + return result; + } public static bool operator >(PerkAbilityData objA, PerkAbilityData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PerkData.cs b/ESPSharp/Subrecords/GeneratedCode/PerkData.cs index 87dd8ab..c3fc051 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PerkData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PerkData.cs @@ -127,8 +127,10 @@ public override object Clone() public int CompareTo(PerkData other) { - return MinLevel.CompareTo(other.MinLevel); - } + int result = 0; + + return result; + } public static bool operator >(PerkData objA, PerkData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PerkEffectHeader.cs b/ESPSharp/Subrecords/GeneratedCode/PerkEffectHeader.cs index 6b63ae4..9ead2a3 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PerkEffectHeader.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PerkEffectHeader.cs @@ -103,8 +103,19 @@ public override object Clone() public int CompareTo(PerkEffectHeader other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + if (result == 0 && Rank != null && other.Rank != null) + result = Rank.CompareTo(other.Rank); + + if (result == 0 && Priority != null && other.Priority != null) + result = Priority.CompareTo(other.Priority); + + if (result == 0 && Type != null && other.Type != null) + result = Type.CompareTo(other.Type); + + return result; + } public static bool operator >(PerkEffectHeader objA, PerkEffectHeader objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PerkEffectHeader.tt b/ESPSharp/Subrecords/GeneratedCode/PerkEffectHeader.tt index f1e1221..96864a8 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PerkEffectHeader.tt +++ b/ESPSharp/Subrecords/GeneratedCode/PerkEffectHeader.tt @@ -3,6 +3,7 @@ <# ClassTemplate template = new ClassTemplate(); template.ClassName = "PerkEffectHeader"; + template.isComparable = true; ClassField tempField; @@ -13,6 +14,7 @@ "Type" ); template.hashKey = tempField; + tempField.sortIndex = 2; template.Fields.Add(tempField); tempField = @@ -21,6 +23,7 @@ "Rank", "Rank" ); + tempField.sortIndex = 0; template.Fields.Add(tempField); tempField = @@ -29,6 +32,7 @@ "Priority", "Priority" ); + tempField.sortIndex = 1; template.Fields.Add(tempField); #> <#@ include file="SubrecordTemplate.t4" once="true" #> \ No newline at end of file diff --git a/ESPSharp/Subrecords/GeneratedCode/PerkEntryPointData.cs b/ESPSharp/Subrecords/GeneratedCode/PerkEntryPointData.cs index 06d7f85..dce9ab6 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PerkEntryPointData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PerkEntryPointData.cs @@ -103,8 +103,10 @@ public override object Clone() public int CompareTo(PerkEntryPointData other) { - return EntryPoint.CompareTo(other.EntryPoint); - } + int result = 0; + + return result; + } public static bool operator >(PerkEntryPointData objA, PerkEntryPointData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PerkQuestStageData.cs b/ESPSharp/Subrecords/GeneratedCode/PerkQuestStageData.cs index a41fb31..5b5b2fb 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PerkQuestStageData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PerkQuestStageData.cs @@ -92,8 +92,10 @@ public override object Clone() public int CompareTo(PerkQuestStageData other) { - return Quest.CompareTo(other.Quest); - } + int result = 0; + + return result; + } public static bool operator >(PerkQuestStageData objA, PerkQuestStageData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PlaceableWaterData.cs b/ESPSharp/Subrecords/GeneratedCode/PlaceableWaterData.cs index 4e0715d..2d1d9e0 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PlaceableWaterData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PlaceableWaterData.cs @@ -92,8 +92,10 @@ public override object Clone() public int CompareTo(PlaceableWaterData other) { - return WaterType.CompareTo(other.WaterType); - } + int result = 0; + + return result; + } public static bool operator >(PlaceableWaterData objA, PlaceableWaterData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PlaneData.cs b/ESPSharp/Subrecords/GeneratedCode/PlaneData.cs index 0ff2a9f..2d0190b 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PlaneData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PlaneData.cs @@ -175,8 +175,10 @@ public override object Clone() public int CompareTo(PlaneData other) { - return Width.CompareTo(other.Width); - } + int result = 0; + + return result; + } public static bool operator >(PlaneData objA, PlaneData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PluginHeader.cs b/ESPSharp/Subrecords/GeneratedCode/PluginHeader.cs index f249f99..a0fb4eb 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PluginHeader.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PluginHeader.cs @@ -103,8 +103,10 @@ public override object Clone() public int CompareTo(PluginHeader other) { - return RecordCount.CompareTo(other.RecordCount); - } + int result = 0; + + return result; + } public static bool operator >(PluginHeader objA, PluginHeader objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PositionRotation.cs b/ESPSharp/Subrecords/GeneratedCode/PositionRotation.cs index c48859e..a15a34e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PositionRotation.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PositionRotation.cs @@ -139,8 +139,10 @@ public override object Clone() public int CompareTo(PositionRotation other) { - return PositionX.CompareTo(other.PositionX); - } + int result = 0; + + return result; + } public static bool operator >(PositionRotation objA, PositionRotation objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/PrimitiveData.cs b/ESPSharp/Subrecords/GeneratedCode/PrimitiveData.cs index 358b3e2..10da35e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/PrimitiveData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/PrimitiveData.cs @@ -167,8 +167,10 @@ public override object Clone() public int CompareTo(PrimitiveData other) { - return XBound.CompareTo(other.XBound); - } + int result = 0; + + return result; + } public static bool operator >(PrimitiveData objA, PrimitiveData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ProjectileData.cs b/ESPSharp/Subrecords/GeneratedCode/ProjectileData.cs index 59fdde4..1a50a50 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ProjectileData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ProjectileData.cs @@ -338,8 +338,10 @@ public override object Clone() public int CompareTo(ProjectileData other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(ProjectileData objA, ProjectileData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/QuestData.cs b/ESPSharp/Subrecords/GeneratedCode/QuestData.cs index 07e7fdc..1ba3f3e 100644 --- a/ESPSharp/Subrecords/GeneratedCode/QuestData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/QuestData.cs @@ -117,8 +117,10 @@ public override object Clone() public int CompareTo(QuestData other) { - return Priority.CompareTo(other.Priority); - } + int result = 0; + + return result; + } public static bool operator >(QuestData objA, QuestData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/QuestTargetData.cs b/ESPSharp/Subrecords/GeneratedCode/QuestTargetData.cs index 53aa710..769d3dd 100644 --- a/ESPSharp/Subrecords/GeneratedCode/QuestTargetData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/QuestTargetData.cs @@ -106,8 +106,10 @@ public override object Clone() public int CompareTo(QuestTargetData other) { - return Target.CompareTo(other.Target); - } + int result = 0; + + return result; + } public static bool operator >(QuestTargetData objA, QuestTargetData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RaceData.cs b/ESPSharp/Subrecords/GeneratedCode/RaceData.cs index c9ddd07..8b0efe5 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RaceData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RaceData.cs @@ -309,8 +309,10 @@ public override object Clone() public int CompareTo(RaceData other) { - return MaleHeight.CompareTo(other.MaleHeight); - } + int result = 0; + + return result; + } public static bool operator >(RaceData objA, RaceData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RaceDefaultHairColors.cs b/ESPSharp/Subrecords/GeneratedCode/RaceDefaultHairColors.cs index cdc3e7c..f775520 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RaceDefaultHairColors.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RaceDefaultHairColors.cs @@ -91,8 +91,10 @@ public override object Clone() public int CompareTo(RaceDefaultHairColors other) { - return MaleColor.CompareTo(other.MaleColor); - } + int result = 0; + + return result; + } public static bool operator >(RaceDefaultHairColors objA, RaceDefaultHairColors objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RaceDefaultHairStyles.cs b/ESPSharp/Subrecords/GeneratedCode/RaceDefaultHairStyles.cs index b69198c..8bb70a8 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RaceDefaultHairStyles.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RaceDefaultHairStyles.cs @@ -93,8 +93,10 @@ public override object Clone() public int CompareTo(RaceDefaultHairStyles other) { - return MaleStyle.CompareTo(other.MaleStyle); - } + int result = 0; + + return result; + } public static bool operator >(RaceDefaultHairStyles objA, RaceDefaultHairStyles objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RaceDefaultVoices.cs b/ESPSharp/Subrecords/GeneratedCode/RaceDefaultVoices.cs index 2cd4503..b3fc3b6 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RaceDefaultVoices.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RaceDefaultVoices.cs @@ -93,8 +93,10 @@ public override object Clone() public int CompareTo(RaceDefaultVoices other) { - return MaleVoice.CompareTo(other.MaleVoice); - } + int result = 0; + + return result; + } public static bool operator >(RaceDefaultVoices objA, RaceDefaultVoices objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RadioData.cs b/ESPSharp/Subrecords/GeneratedCode/RadioData.cs index abec492..e47665b 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RadioData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RadioData.cs @@ -116,8 +116,10 @@ public override object Clone() public int CompareTo(RadioData other) { - return PositionReference.CompareTo(other.PositionReference); - } + int result = 0; + + return result; + } public static bool operator >(RadioData objA, RadioData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RagdollData.cs b/ESPSharp/Subrecords/GeneratedCode/RagdollData.cs index cc232c5..d62c72d 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RagdollData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RagdollData.cs @@ -163,8 +163,10 @@ public override object Clone() public int CompareTo(RagdollData other) { - return DynamicBoneCount.CompareTo(other.DynamicBoneCount); - } + int result = 0; + + return result; + } public static bool operator >(RagdollData objA, RagdollData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RagdollFeedbackData.cs b/ESPSharp/Subrecords/GeneratedCode/RagdollFeedbackData.cs index 4efbe08..e418f1c 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RagdollFeedbackData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RagdollFeedbackData.cs @@ -247,8 +247,10 @@ public override object Clone() public int CompareTo(RagdollFeedbackData other) { - return Dynamic_KeyframeBlendAmount.CompareTo(other.Dynamic_KeyframeBlendAmount); - } + int result = 0; + + return result; + } public static bool operator >(RagdollFeedbackData objA, RagdollFeedbackData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RagdollPoseMatching.cs b/ESPSharp/Subrecords/GeneratedCode/RagdollPoseMatching.cs index 447ac3a..928846b 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RagdollPoseMatching.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RagdollPoseMatching.cs @@ -173,8 +173,10 @@ public override object Clone() public int CompareTo(RagdollPoseMatching other) { - return MatchBone1.CompareTo(other.MatchBone1); - } + int result = 0; + + return result; + } public static bool operator >(RagdollPoseMatching objA, RagdollPoseMatching objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RecipeData.cs b/ESPSharp/Subrecords/GeneratedCode/RecipeData.cs index c9f4d8a..295cb5b 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RecipeData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RecipeData.cs @@ -117,8 +117,10 @@ public override object Clone() public int CompareTo(RecipeData other) { - return Skill.CompareTo(other.Skill); - } + int result = 0; + + return result; + } public static bool operator >(RecipeData objA, RecipeData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RecordReference.cs b/ESPSharp/Subrecords/GeneratedCode/RecordReference.cs index 5db5b42..f47fb86 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RecordReference.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RecordReference.cs @@ -80,8 +80,13 @@ public override object Clone() public int CompareTo(RecordReference other) { - return Reference.CompareTo(other.Reference); - } + int result = 0; + + if (result == 0 && Reference != null && other.Reference != null) + result = Reference.CompareTo(other.Reference); + + return result; + } public static bool operator >(RecordReference objA, RecordReference objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RecordReference.tt b/ESPSharp/Subrecords/GeneratedCode/RecordReference.tt index 23a3bee..7e006b8 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RecordReference.tt +++ b/ESPSharp/Subrecords/GeneratedCode/RecordReference.tt @@ -12,6 +12,7 @@ "Reference", "Reference" ); + tempField.sortIndex = 0; template.hashKey = tempField; template.Fields.Add(tempField); #> diff --git a/ESPSharp/Subrecords/GeneratedCode/RegionDataHeader.cs b/ESPSharp/Subrecords/GeneratedCode/RegionDataHeader.cs index c8cf3c8..131567d 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RegionDataHeader.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RegionDataHeader.cs @@ -117,8 +117,10 @@ public override object Clone() public int CompareTo(RegionDataHeader other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(RegionDataHeader objA, RegionDataHeader objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RelatedCameraPaths.cs b/ESPSharp/Subrecords/GeneratedCode/RelatedCameraPaths.cs index e7000cc..9dd5c52 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RelatedCameraPaths.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RelatedCameraPaths.cs @@ -93,8 +93,10 @@ public override object Clone() public int CompareTo(RelatedCameraPaths other) { - return Parent.CompareTo(other.Parent); - } + int result = 0; + + return result; + } public static bool operator >(RelatedCameraPaths objA, RelatedCameraPaths objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RelatedIdleAnims.cs b/ESPSharp/Subrecords/GeneratedCode/RelatedIdleAnims.cs index d7777f6..0d2bd2f 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RelatedIdleAnims.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RelatedIdleAnims.cs @@ -93,8 +93,10 @@ public override object Clone() public int CompareTo(RelatedIdleAnims other) { - return Parent.CompareTo(other.Parent); - } + int result = 0; + + return result; + } public static bool operator >(RelatedIdleAnims objA, RelatedIdleAnims objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RelatedWaters.cs b/ESPSharp/Subrecords/GeneratedCode/RelatedWaters.cs index 9ee561c..1d7c719 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RelatedWaters.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RelatedWaters.cs @@ -106,8 +106,10 @@ public override object Clone() public int CompareTo(RelatedWaters other) { - return Daytime.CompareTo(other.Daytime); - } + int result = 0; + + return result; + } public static bool operator >(RelatedWaters objA, RelatedWaters objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/Relationship.cs b/ESPSharp/Subrecords/GeneratedCode/Relationship.cs index bbe13c8..ea64911 100644 --- a/ESPSharp/Subrecords/GeneratedCode/Relationship.cs +++ b/ESPSharp/Subrecords/GeneratedCode/Relationship.cs @@ -104,8 +104,10 @@ public override object Clone() public int CompareTo(Relationship other) { - return Faction.CompareTo(other.Faction); - } + int result = 0; + + return result; + } public static bool operator >(Relationship objA, Relationship objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ResponseData.cs b/ESPSharp/Subrecords/GeneratedCode/ResponseData.cs index 12e2e3d..f9b27d2 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ResponseData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ResponseData.cs @@ -170,8 +170,10 @@ public override object Clone() public int CompareTo(ResponseData other) { - return ResponseNumber.CompareTo(other.ResponseNumber); - } + int result = 0; + + return result; + } public static bool operator >(ResponseData objA, ResponseData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/RoomDataHeader.cs b/ESPSharp/Subrecords/GeneratedCode/RoomDataHeader.cs index 2c70a28..a373724 100644 --- a/ESPSharp/Subrecords/GeneratedCode/RoomDataHeader.cs +++ b/ESPSharp/Subrecords/GeneratedCode/RoomDataHeader.cs @@ -95,8 +95,10 @@ public override object Clone() public int CompareTo(RoomDataHeader other) { - return LinkedRoomsCount.CompareTo(other.LinkedRoomsCount); - } + int result = 0; + + return result; + } public static bool operator >(RoomDataHeader objA, RoomDataHeader objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ScriptData.cs b/ESPSharp/Subrecords/GeneratedCode/ScriptData.cs index 1590137..9e37958 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ScriptData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ScriptData.cs @@ -141,8 +141,10 @@ public override object Clone() public int CompareTo(ScriptData other) { - return CompiledSize.CompareTo(other.CompiledSize); - } + int result = 0; + + return result; + } public static bool operator >(ScriptData objA, ScriptData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/SoundAttenuation.cs b/ESPSharp/Subrecords/GeneratedCode/SoundAttenuation.cs index 43d784b..fc98895 100644 --- a/ESPSharp/Subrecords/GeneratedCode/SoundAttenuation.cs +++ b/ESPSharp/Subrecords/GeneratedCode/SoundAttenuation.cs @@ -127,8 +127,10 @@ public override object Clone() public int CompareTo(SoundAttenuation other) { - return Point1.CompareTo(other.Point1); - } + int result = 0; + + return result; + } public static bool operator >(SoundAttenuation objA, SoundAttenuation objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/SoundData.cs b/ESPSharp/Subrecords/GeneratedCode/SoundData.cs index fc49c2f..2399bc9 100644 --- a/ESPSharp/Subrecords/GeneratedCode/SoundData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/SoundData.cs @@ -261,8 +261,10 @@ public override object Clone() public int CompareTo(SoundData other) { - return Priority.CompareTo(other.Priority); - } + int result = 0; + + return result; + } public static bool operator >(SoundData objA, SoundData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/SoundDataShort.cs b/ESPSharp/Subrecords/GeneratedCode/SoundDataShort.cs index 778a619..3e7a4a2 100644 --- a/ESPSharp/Subrecords/GeneratedCode/SoundDataShort.cs +++ b/ESPSharp/Subrecords/GeneratedCode/SoundDataShort.cs @@ -161,8 +161,10 @@ public override object Clone() public int CompareTo(SoundDataShort other) { - return MinAttenuationDistance.CompareTo(other.MinAttenuationDistance); - } + int result = 0; + + return result; + } public static bool operator >(SoundDataShort objA, SoundDataShort objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/SpellData.cs b/ESPSharp/Subrecords/GeneratedCode/SpellData.cs index de9c527..d0c0c21 100644 --- a/ESPSharp/Subrecords/GeneratedCode/SpellData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/SpellData.cs @@ -129,8 +129,10 @@ public override object Clone() public int CompareTo(SpellData other) { - return Type.CompareTo(other.Type); - } + int result = 0; + + return result; + } public static bool operator >(SpellData objA, SpellData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/StaticCollectionPartData.cs b/ESPSharp/Subrecords/GeneratedCode/StaticCollectionPartData.cs index c26726a..c105ae4 100644 --- a/ESPSharp/Subrecords/GeneratedCode/StaticCollectionPartData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/StaticCollectionPartData.cs @@ -59,6 +59,7 @@ protected override void ReadData(ESPReader reader) protected override void WriteData(ESPWriter writer) { + Placements.Sort(); foreach (var temp in Placements) { temp.WriteBinary(writer); @@ -70,6 +71,7 @@ protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) XElement subEle; ele.TryPathTo("Placements", true, out subEle); + Placements.Sort(); foreach (var temp in Placements) { XElement e = new XElement("Placement"); diff --git a/ESPSharp/Subrecords/GeneratedCode/StaticCollectionPartData.tt b/ESPSharp/Subrecords/GeneratedCode/StaticCollectionPartData.tt index 1b2231d..ad02dd6 100644 --- a/ESPSharp/Subrecords/GeneratedCode/StaticCollectionPartData.tt +++ b/ESPSharp/Subrecords/GeneratedCode/StaticCollectionPartData.tt @@ -12,6 +12,8 @@ "Placements", "Placements" ); + tempField.isSorted = true; + tempField.sortIndex = 0; tempField.XMLSubName = "Placement"; tempField.listItemSize = 28; template.hashKey = tempField; diff --git a/ESPSharp/Subrecords/GeneratedCode/SubrecordTemplate.t4 b/ESPSharp/Subrecords/GeneratedCode/SubrecordTemplate.t4 index 3c360c1..994d502 100644 --- a/ESPSharp/Subrecords/GeneratedCode/SubrecordTemplate.t4 +++ b/ESPSharp/Subrecords/GeneratedCode/SubrecordTemplate.t4 @@ -99,8 +99,15 @@ namespace ESPSharp.Subrecords <# if(template.isComparable) { #> public int CompareTo(<#= template.ClassName #> other) { - <# WriteCompareHashKeyCommand(template); #> - } + int result = 0; +<# foreach (var field in template.Fields.Where(f => f.sortIndex >= 0).OrderBy(o => o.sortIndex)) { #> + + if (result == 0 && <#= field.Name#> != null && other.<#= field.Name#> != null) + <# WriteCompareCommand(field); #> +<# } #> + + return result; + } public static bool operator >(<#= template.ClassName #> objA, <#= template.ClassName #> objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/SwappedImpact.cs b/ESPSharp/Subrecords/GeneratedCode/SwappedImpact.cs index a157b19..0a73ab6 100644 --- a/ESPSharp/Subrecords/GeneratedCode/SwappedImpact.cs +++ b/ESPSharp/Subrecords/GeneratedCode/SwappedImpact.cs @@ -105,8 +105,10 @@ public override object Clone() public int CompareTo(SwappedImpact other) { - return MaterialType.CompareTo(other.MaterialType); - } + int result = 0; + + return result; + } public static bool operator >(SwappedImpact objA, SwappedImpact objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/TeleportDestinationData.cs b/ESPSharp/Subrecords/GeneratedCode/TeleportDestinationData.cs index 4af60f8..1e8247c 100644 --- a/ESPSharp/Subrecords/GeneratedCode/TeleportDestinationData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/TeleportDestinationData.cs @@ -164,8 +164,10 @@ public override object Clone() public int CompareTo(TeleportDestinationData other) { - return Door.CompareTo(other.Door); - } + int result = 0; + + return result; + } public static bool operator >(TeleportDestinationData objA, TeleportDestinationData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/TerminalData.cs b/ESPSharp/Subrecords/GeneratedCode/TerminalData.cs index 0eb0728..11267fc 100644 --- a/ESPSharp/Subrecords/GeneratedCode/TerminalData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/TerminalData.cs @@ -117,8 +117,10 @@ public override object Clone() public int CompareTo(TerminalData other) { - return HackingDifficulty.CompareTo(other.HackingDifficulty); - } + int result = 0; + + return result; + } public static bool operator >(TerminalData objA, TerminalData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ThresholdData.cs b/ESPSharp/Subrecords/GeneratedCode/ThresholdData.cs index 90cd695..fb6b236 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ThresholdData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ThresholdData.cs @@ -92,8 +92,10 @@ public override object Clone() public int CompareTo(ThresholdData other) { - return TriggerThreshold.CompareTo(other.TriggerThreshold); - } + int result = 0; + + return result; + } public static bool operator >(ThresholdData objA, ThresholdData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/TreeData.cs b/ESPSharp/Subrecords/GeneratedCode/TreeData.cs index 28e0054..abf6080 100644 --- a/ESPSharp/Subrecords/GeneratedCode/TreeData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/TreeData.cs @@ -163,8 +163,10 @@ public override object Clone() public int CompareTo(TreeData other) { - return LeafCurvature.CompareTo(other.LeafCurvature); - } + int result = 0; + + return result; + } public static bool operator >(TreeData objA, TreeData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/ValueWeight.cs b/ESPSharp/Subrecords/GeneratedCode/ValueWeight.cs index 8a20496..d201de5 100644 --- a/ESPSharp/Subrecords/GeneratedCode/ValueWeight.cs +++ b/ESPSharp/Subrecords/GeneratedCode/ValueWeight.cs @@ -91,8 +91,10 @@ public override object Clone() public int CompareTo(ValueWeight other) { - return Value.CompareTo(other.Value); - } + int result = 0; + + return result; + } public static bool operator >(ValueWeight objA, ValueWeight objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WaterData.cs b/ESPSharp/Subrecords/GeneratedCode/WaterData.cs index 95e96e9..bde3d94 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WaterData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WaterData.cs @@ -630,8 +630,10 @@ public override object Clone() public int CompareTo(WaterData other) { - return WaterPropertiesSunPower.CompareTo(other.WaterPropertiesSunPower); - } + int result = 0; + + return result; + } public static bool operator >(WaterData objA, WaterData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WaterDataAndDamage.cs b/ESPSharp/Subrecords/GeneratedCode/WaterDataAndDamage.cs index 40e1a2d..1d4db67 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WaterDataAndDamage.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WaterDataAndDamage.cs @@ -642,8 +642,10 @@ public override object Clone() public int CompareTo(WaterDataAndDamage other) { - return WaterPropertiesSunPower.CompareTo(other.WaterPropertiesSunPower); - } + int result = 0; + + return result; + } public static bool operator >(WaterDataAndDamage objA, WaterDataAndDamage objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WaterReflection.cs b/ESPSharp/Subrecords/GeneratedCode/WaterReflection.cs index 8168fd3..296f0b0 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WaterReflection.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WaterReflection.cs @@ -92,8 +92,10 @@ public override object Clone() public int CompareTo(WaterReflection other) { - return Reference.CompareTo(other.Reference); - } + int result = 0; + + return result; + } public static bool operator >(WaterReflection objA, WaterReflection objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WeaponCriticalHitData.cs b/ESPSharp/Subrecords/GeneratedCode/WeaponCriticalHitData.cs index 875839e..7c7abbc 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WeaponCriticalHitData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WeaponCriticalHitData.cs @@ -144,8 +144,10 @@ public override object Clone() public int CompareTo(WeaponCriticalHitData other) { - return Damage.CompareTo(other.Damage); - } + int result = 0; + + return result; + } public static bool operator >(WeaponCriticalHitData objA, WeaponCriticalHitData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WeaponData.cs b/ESPSharp/Subrecords/GeneratedCode/WeaponData.cs index 2770d9b..1eabd03 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WeaponData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WeaponData.cs @@ -127,8 +127,10 @@ public override object Clone() public int CompareTo(WeaponData other) { - return BaseDamage.CompareTo(other.BaseDamage); - } + int result = 0; + + return result; + } public static bool operator >(WeaponData objA, WeaponData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WeaponExtraData.cs b/ESPSharp/Subrecords/GeneratedCode/WeaponExtraData.cs index 16e8f8c..36cc39a 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WeaponExtraData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WeaponExtraData.cs @@ -784,8 +784,10 @@ public override object Clone() public int CompareTo(WeaponExtraData other) { - return Skill.CompareTo(other.Skill); - } + int result = 0; + + return result; + } public static bool operator >(WeaponExtraData objA, WeaponExtraData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WeaponVATSData.cs b/ESPSharp/Subrecords/GeneratedCode/WeaponVATSData.cs index 988e4ae..c6483a6 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WeaponVATSData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WeaponVATSData.cs @@ -154,8 +154,10 @@ public override object Clone() public int CompareTo(WeaponVATSData other) { - return Effect.CompareTo(other.Effect); - } + int result = 0; + + return result; + } public static bool operator >(WeaponVATSData objA, WeaponVATSData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WeatherData.cs b/ESPSharp/Subrecords/GeneratedCode/WeatherData.cs index 6f4ac9d..05143e5 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WeatherData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WeatherData.cs @@ -247,8 +247,10 @@ public override object Clone() public int CompareTo(WeatherData other) { - return Classification.CompareTo(other.Classification); - } + int result = 0; + + return result; + } public static bool operator >(WeatherData objA, WeatherData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WeatherFogDistance.cs b/ESPSharp/Subrecords/GeneratedCode/WeatherFogDistance.cs index 67de602..5a7efca 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WeatherFogDistance.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WeatherFogDistance.cs @@ -139,8 +139,10 @@ public override object Clone() public int CompareTo(WeatherFogDistance other) { - return DayNear.CompareTo(other.DayNear); - } + int result = 0; + + return result; + } public static bool operator >(WeatherFogDistance objA, WeatherFogDistance objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WeatherSound.cs b/ESPSharp/Subrecords/GeneratedCode/WeatherSound.cs index f4193a1..cb3e0c8 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WeatherSound.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WeatherSound.cs @@ -92,8 +92,10 @@ public override object Clone() public int CompareTo(WeatherSound other) { - return Sound.CompareTo(other.Sound); - } + int result = 0; + + return result; + } public static bool operator >(WeatherSound objA, WeatherSound objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WorldLandData.cs b/ESPSharp/Subrecords/GeneratedCode/WorldLandData.cs index acf8039..b53c107 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WorldLandData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WorldLandData.cs @@ -90,8 +90,10 @@ public override object Clone() public int CompareTo(WorldLandData other) { - return DefaultLandHeight.CompareTo(other.DefaultLandHeight); - } + int result = 0; + + return result; + } public static bool operator >(WorldLandData objA, WorldLandData objB) { diff --git a/ESPSharp/Subrecords/GeneratedCode/WorldMapOffsetData.cs b/ESPSharp/Subrecords/GeneratedCode/WorldMapOffsetData.cs index f5662b9..62d05fb 100644 --- a/ESPSharp/Subrecords/GeneratedCode/WorldMapOffsetData.cs +++ b/ESPSharp/Subrecords/GeneratedCode/WorldMapOffsetData.cs @@ -102,8 +102,10 @@ public override object Clone() public int CompareTo(WorldMapOffsetData other) { - return WorldMapScale.CompareTo(other.WorldMapScale); - } + int result = 0; + + return result; + } public static bool operator >(WorldMapOffsetData objA, WorldMapOffsetData objB) { diff --git a/ESPSharp/T4/ClassTemplate.cs b/ESPSharp/T4/ClassTemplate.cs index 6139cf8..50f2296 100644 --- a/ESPSharp/T4/ClassTemplate.cs +++ b/ESPSharp/T4/ClassTemplate.cs @@ -302,14 +302,14 @@ public void WriteReadXMLCommand(ClassField field, int indent = 3) ClearIndent(); } - public void WriteCompareHashKeyCommand(ClassTemplate template, int indent = 3) + public void WriteCompareCommand(ClassField field, int indent = 4) { SetIndent(indent); - if (template.hashKey.Type == typeof(byte[])) - WriteLine("return {0}.GetHashCode().CompareTo(other.{0}.GetHashCode());", template.hashKey.Name); + if (field.Type == typeof(byte[])) + WriteLine("result = {0}.GetHashCode().CompareTo(other.{0}.GetHashCode());", field.Name); else - WriteLine("return {0}.CompareTo(other.{0});", template.hashKey.Name); + WriteLine("result = {0}.CompareTo(other.{0});", field.Name); ClearIndent(); } @@ -333,6 +333,7 @@ public class ClassField public string XMLPath; public string XMLSubName; public string DefaultValue; + public int sortIndex = -1; public bool hasListCount = false; public bool isReadOnly = false;