Move CurrentWeaponHash to full sync

This commit is contained in:
Sardelka
2022-08-08 17:29:15 +08:00
parent 83d79b0a17
commit 01524b1796
4 changed files with 24 additions and 12 deletions

View File

@ -38,7 +38,6 @@ namespace RageCoop.Core
public Vector3 AimCoords { get; set; }
public uint CurrentWeaponHash { get; set; }
public float Heading { get; set; }
@ -46,6 +45,8 @@ namespace RageCoop.Core
public int ModelHash { get; set; }
public uint CurrentWeaponHash { get; set; }
public byte[] Clothes { get; set; }
public Dictionary<uint, bool> WeaponComponents { get; set; }
@ -99,8 +100,6 @@ namespace RageCoop.Core
// Write ped speed
byteArray.Add(Speed);
// Write ped weapon hash
byteArray.AddRange(BitConverter.GetBytes(CurrentWeaponHash));
if (Flags.HasPedFlag(PedDataFlags.IsAiming))
{
@ -115,6 +114,9 @@ namespace RageCoop.Core
// Write model hash
byteArray.AddInt(ModelHash);
// Write ped weapon hash
byteArray.AddUint(CurrentWeaponHash);
byteArray.AddRange(Clothes);
// Write player weapon components
@ -185,8 +187,6 @@ namespace RageCoop.Core
// Read player speed
Speed = reader.ReadByte();
// Read player weapon hash
CurrentWeaponHash = reader.ReadUInt32();
// Try to read aim coords
if (Flags.HasPedFlag(PedDataFlags.IsAiming))
@ -202,6 +202,9 @@ namespace RageCoop.Core
// Read player model hash
ModelHash = reader.ReadInt32();
// Read player weapon hash
CurrentWeaponHash = reader.ReadUInt32();
// Read player clothes
Clothes =reader.ReadBytes(36);