Remove reduandant else from getRepairableItemQualityValue()
This commit is contained in:
parent
c527824d60
commit
df6a08367b
@ -363,7 +363,7 @@ class ItemHelper
|
|||||||
// Edge case, max durability is below durability
|
// Edge case, max durability is below durability
|
||||||
if (repairable.Durability < repairable.MaxDurability)
|
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`);
|
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;
|
repairable.MaxDurability = repairable.Durability;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,24 +372,22 @@ class ItemHelper
|
|||||||
{
|
{
|
||||||
return repairable.Durability / itemDetails._props.MaxDurability;
|
return repairable.Durability / itemDetails._props.MaxDurability;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
// Weapon
|
||||||
|
// Get max dura from props, if it isnt there use repairable max dura value
|
||||||
|
const maxDurability = (itemDetails._props.MaxDurability)
|
||||||
|
? itemDetails._props.MaxDurability
|
||||||
|
: repairable.MaxDurability;
|
||||||
|
const durability = repairable.Durability / maxDurability;
|
||||||
|
|
||||||
|
if (!durability)
|
||||||
{
|
{
|
||||||
// Weapon
|
this.logger.error(this.localisationService.getText("item-durability_value_invalid_use_default", item._tpl));
|
||||||
// Get max dura from props, if it isnt there use repairable max dura value
|
|
||||||
const maxDurability = (itemDetails._props.MaxDurability)
|
|
||||||
? itemDetails._props.MaxDurability
|
|
||||||
: repairable.MaxDurability;
|
|
||||||
const durability = repairable.Durability / maxDurability;
|
|
||||||
|
|
||||||
if (!durability)
|
return 1;
|
||||||
{
|
|
||||||
this.logger.error(this.localisationService.getText("item-durability_value_invalid_use_default", item._tpl));
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Math.sqrt(durability);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Math.sqrt(durability);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user