Merge branch '3.8.0' of https://dev.sp-tarkov.com/SPT-AKI/Server into testing-redux
This commit is contained in:
commit
5656384c8f
@ -360,13 +360,19 @@ class ItemHelper
|
|||||||
*/
|
*/
|
||||||
protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number
|
protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number
|
||||||
{
|
{
|
||||||
|
// Edge case, max durability is below durability
|
||||||
|
if (repairable.Durability < repairable.MaxDurability)
|
||||||
|
{
|
||||||
|
this.logger.warning(`Max durability: ${repairable.MaxDurability} for item id: ${item._id} was below Durability: ${repairable.Durability}, adjusting values to match`);
|
||||||
|
repairable.MaxDurability = repairable.Durability;
|
||||||
|
}
|
||||||
|
|
||||||
// Armor
|
// Armor
|
||||||
if (itemDetails._props.armorClass)
|
if (itemDetails._props.armorClass)
|
||||||
{
|
{
|
||||||
return repairable.Durability / itemDetails._props.MaxDurability;
|
return repairable.Durability / itemDetails._props.MaxDurability;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Weapon
|
// Weapon
|
||||||
// Get max dura from props, if it isnt there use repairable max dura value
|
// Get max dura from props, if it isnt there use repairable max dura value
|
||||||
const maxDurability = (itemDetails._props.MaxDurability)
|
const maxDurability = (itemDetails._props.MaxDurability)
|
||||||
@ -383,7 +389,6 @@ class ItemHelper
|
|||||||
|
|
||||||
return Math.sqrt(durability);
|
return Math.sqrt(durability);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results
|
* Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results
|
||||||
|
Loading…
x
Reference in New Issue
Block a user