Skip to content

Commit e6dab63

Browse files
committed
update
1 parent 371971e commit e6dab63

7 files changed

Lines changed: 7311 additions & 1451 deletions

File tree

RageLib.GTA5/ResourceWrappers/PC/Meta/Convert/MetaXml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static string GetXml(MetaFile meta)
4040
{
4141
var cont = new MetaCont(meta);
4242

43-
WriteNode(sb, 0, cont, meta.RootBlockIndex, 0, XmlTagMode.Structure, 0, (string)meta.Name);
43+
WriteNode(sb, 0, cont, meta.RootBlockIndex, 0, XmlTagMode.Structure, 0, meta.Name is null ? "" : (string)meta.Name);
4444
}
4545

4646
return sb.ToString();

RageLib.GTA5/ResourceWrappers/PC/Meta/Structures/MCEntityDef.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public MCEntityDef ParentEntity
119119
}
120120
else
121121
{
122-
this._ParentIndex = value.Parent.Entities.IndexOf(value);
122+
this._ParentIndex = value.Parent?.Entities.IndexOf(value) ?? -1;
123123
}
124124

125125
if (this._ParentEntity != null && this.ParentEntity.Children.IndexOf(this) == -1)

RageLib.GTA5/Resources/PC/Drawables/VertexDeclaration.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ public override long Length
1010
}
1111

1212
// structure data
13-
public uint Flags { get; set; }
14-
public ushort Stride { get; set; }
15-
public byte Unknown_6h { get; set; }
16-
public byte Count { get; set; }
17-
public ulong Types { get; set; }
13+
public uint Flags;
14+
public ushort Stride;
15+
public byte Unknown_6h;
16+
public byte Count;
17+
public ulong Types;
1818

1919
/// <summary>
2020
/// Reads the data-block from a stream.

RageLib.GTA5/Resources/PC/GameFiles/YmapFile.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public override void Parse(object[] parameters = null)
6262

6363
public override void Build(object[] parameters = null)
6464
{
65+
for (int i = 0; i < this.CMapData.Entities.Count; i++)
66+
this.CMapData.Entities[i].ParentEntity = this.CMapData.Entities[i].ParentEntity;
67+
6568
var mb = new MetaBuilder();
6669

6770
mb.EnsureBlock(MetaName.CMapData);

RageLib.GTA5/Resources/PC/GameFiles/YmtPedDefinitionFile.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ THE SOFTWARE.
2424
using System.Collections.Generic;
2525
using RageLib.GTA5.Resources.PC;
2626
using RageLib.GTA5.ResourceWrappers.PC.Meta.Structures;
27+
using RageLib.Resources.Common;
2728

2829
using RageLib.Resources.GTA5.PC.Meta;
2930
using SharpDX;
@@ -33,6 +34,7 @@ namespace RageLib.Resources.GTA5.PC.GameFiles
3334
public class YmtPedDefinitionFile : GameFileBase_Resource<MetaFile>
3435
{
3536
public MUnk_376833625 Unk_376833625;
37+
public string metaYmtName = "";
3638

3739
public YmtPedDefinitionFile()
3840
{
@@ -50,6 +52,8 @@ public override void Parse(object[] parameters = null)
5052
this.Unk_376833625 = new RageLib.GTA5.ResourceWrappers.PC.Meta.Structures.MUnk_376833625();
5153

5254
this.Unk_376833625.Parse(this.ResourceFile.ResourceData, Unk_376833625);
55+
56+
this.metaYmtName = (string)this.ResourceFile.ResourceData.Name;
5357
}
5458

5559
public override void Build(object[] parameters = null)
@@ -60,6 +64,8 @@ public override void Build(object[] parameters = null)
6064

6165
this.Unk_376833625.Build(mb, true);
6266

67+
this.Unk_376833625.Meta.Name = (string_r)metaYmtName;
68+
6369
ResourceFile.Version = ResourceFileTypes_GTA5_pc.Meta.Version;
6470
ResourceFile.ResourceData = this.Unk_376833625.Meta;
6571
}

0 commit comments

Comments
 (0)