Don't use dictionary to store vehicle mods

This commit is contained in:
Sardelka9515
2023-03-20 17:14:52 +08:00
parent 7cd0fd22af
commit 5f1aadbdb5
4 changed files with 19 additions and 13 deletions

View File

@ -47,10 +47,14 @@ namespace RageCoop.Client
return flags;
}
public static Dictionary<int, int> GetVehicleMods(this VehicleModCollection mods)
public static (int, int)[] GetVehicleMods(this VehicleModCollection mods)
{
var result = new Dictionary<int, int>();
foreach (var mod in mods.ToArray()) result.Add((int)mod.Type, mod.Index);
var modsArr = mods.ToArray();
var result = new (int, int)[modsArr.Length];
for (int i = 0; i < modsArr.Length; i++)
{
result[i] = ((int)modsArr[i].Type, modsArr[i].Index);
}
return result;
}