feat: added support for hashing of mags
This commit is contained in:
parent
0741831f3d
commit
ee5bbbb098
|
@ -4,7 +4,7 @@ using System.Text;
|
||||||
using KeycardTemplate = GClass2623;
|
using KeycardTemplate = GClass2623;
|
||||||
using ArmorTemplate = GClass2550;
|
using ArmorTemplate = GClass2550;
|
||||||
using ArmoredRigTemplate = GClass2602;
|
using ArmoredRigTemplate = GClass2602;
|
||||||
using SimpleMedClass = GClass2631;
|
using MagazineTemplate = GClass2586;
|
||||||
|
|
||||||
namespace LootValueEX.Extensions
|
namespace LootValueEX.Extensions
|
||||||
{
|
{
|
||||||
|
@ -30,6 +30,10 @@ namespace LootValueEX.Extensions
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
StringBuilder prehashString = new StringBuilder();
|
StringBuilder prehashString = new StringBuilder();
|
||||||
item.GetAllItems().Where(prop => !prop.Equals(item)).ExecuteForEach(prop => prehashString.Append(prop.GetCustomHash()));
|
item.GetAllItems().Where(prop => !prop.Equals(item)).ExecuteForEach(prop => prehashString.Append(prop.GetCustomHash()));
|
||||||
|
if (item.Template.Equals(typeof(MagazineTemplate))){
|
||||||
|
MagazineTemplate magTemplate = (MagazineTemplate)item.Template;
|
||||||
|
magTemplate.Cartridges.ExecuteForEach(prop => prop.Items.ExecuteForEach(ammo => prehashString.Append(ammo.GetCustomHash())));
|
||||||
|
}
|
||||||
string itemHashTemplate = string.Format("{0}|{1}|{2}|{3}", prehashString.ToString(), item.TemplateId, item.GetDurability(), item.GetUses());
|
string itemHashTemplate = string.Format("{0}|{1}|{2}|{3}", prehashString.ToString(), item.TemplateId, item.GetDurability(), item.GetUses());
|
||||||
return Utils.HashingUtils.ConvertToSha256(itemHashTemplate);
|
return Utils.HashingUtils.ConvertToSha256(itemHashTemplate);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user