Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
indilo53 committed Feb 16, 2020
1 parent 371971e commit e6dab63
Show file tree
Hide file tree
Showing 7 changed files with 7,311 additions and 1,451 deletions.
2 changes: 1 addition & 1 deletion RageLib.GTA5/ResourceWrappers/PC/Meta/Convert/MetaXml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static string GetXml(MetaFile meta)
{
var cont = new MetaCont(meta);

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

return sb.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public MCEntityDef ParentEntity
}
else
{
this._ParentIndex = value.Parent.Entities.IndexOf(value);
this._ParentIndex = value.Parent?.Entities.IndexOf(value) ?? -1;
}

if (this._ParentEntity != null && this.ParentEntity.Children.IndexOf(this) == -1)
Expand Down
10 changes: 5 additions & 5 deletions RageLib.GTA5/Resources/PC/Drawables/VertexDeclaration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ public override long Length
}

// structure data
public uint Flags { get; set; }
public ushort Stride { get; set; }
public byte Unknown_6h { get; set; }
public byte Count { get; set; }
public ulong Types { get; set; }
public uint Flags;
public ushort Stride;
public byte Unknown_6h;
public byte Count;
public ulong Types;

/// <summary>
/// Reads the data-block from a stream.
Expand Down
3 changes: 3 additions & 0 deletions RageLib.GTA5/Resources/PC/GameFiles/YmapFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public override void Parse(object[] parameters = null)

public override void Build(object[] parameters = null)
{
for (int i = 0; i < this.CMapData.Entities.Count; i++)
this.CMapData.Entities[i].ParentEntity = this.CMapData.Entities[i].ParentEntity;

var mb = new MetaBuilder();

mb.EnsureBlock(MetaName.CMapData);
Expand Down
6 changes: 6 additions & 0 deletions RageLib.GTA5/Resources/PC/GameFiles/YmtPedDefinitionFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ THE SOFTWARE.
using System.Collections.Generic;
using RageLib.GTA5.Resources.PC;
using RageLib.GTA5.ResourceWrappers.PC.Meta.Structures;
using RageLib.Resources.Common;

using RageLib.Resources.GTA5.PC.Meta;
using SharpDX;
Expand All @@ -33,6 +34,7 @@ namespace RageLib.Resources.GTA5.PC.GameFiles
public class YmtPedDefinitionFile : GameFileBase_Resource<MetaFile>
{
public MUnk_376833625 Unk_376833625;
public string metaYmtName = "";

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

this.Unk_376833625.Parse(this.ResourceFile.ResourceData, Unk_376833625);

this.metaYmtName = (string)this.ResourceFile.ResourceData.Name;
}

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

this.Unk_376833625.Build(mb, true);

this.Unk_376833625.Meta.Name = (string_r)metaYmtName;

ResourceFile.Version = ResourceFileTypes_GTA5_pc.Meta.Version;
ResourceFile.ResourceData = this.Unk_376833625.Meta;
}
Expand Down
Loading

0 comments on commit e6dab63

Please sign in to comment.