Move GetWeaponComponents to WeaponUtil

This commit is contained in:
Sardelka 2022-07-12 17:14:06 +08:00
parent cf8b54a3b5
commit b7cad3b8f7
2 changed files with 17 additions and 18 deletions

View File

@ -81,24 +81,6 @@ namespace RageCoop.Client
return flags;
}
public static Dictionary<uint, bool> GetWeaponComponents(this Weapon weapon)
{
Dictionary<uint, bool> result = null;
if (weapon.Components.Count > 0)
{
result = new Dictionary<uint, bool>();
foreach (var comp in weapon.Components)
{
result.Add((uint)comp.ComponentHash, comp.Active);
}
}
return result;
}
public static Dictionary<int, int> GetVehicleMods(this VehicleModCollection mods)
{
Dictionary<int, int> result = new Dictionary<int, int>();

View File

@ -21,6 +21,23 @@ namespace RageCoop.Client
}
internal static class WeaponUtil
{
public static Dictionary<uint, bool> GetWeaponComponents(this Weapon weapon)
{
Dictionary<uint, bool> result = null;
if (weapon.Components.Count > 0)
{
result = new Dictionary<uint, bool>();
foreach (var comp in weapon.Components)
{
result.Add((uint)comp.ComponentHash, comp.Active);
}
}
return result;
}
public static Vector3 GetMuzzlePosition(this Ped p)
{
var w = p.Weapons.CurrentWeaponObject;