Durability and initial charges migrated to template.

This commit is contained in:
2024-03-03 08:38:24 -05:00
parent 436d0cec9b
commit d7dfab5e74
6 changed files with 19 additions and 26 deletions
+3 -2
View File
@@ -1246,7 +1246,7 @@ public class ClientMessagePump implements NetMsgHandler {
//apply damaged value reduction
float durabilityCurrent = (short) sell.durabilityCurrent;
float durabilityMax = sell.getDurabilityMax();
float durabilityMax = sell.template.item_health_full;
float damagedModifier = durabilityCurrent / durabilityMax;
cost *= damagedModifier;
float bargain = player.getBargain();
@@ -1640,7 +1640,8 @@ public class ClientMessagePump implements NetMsgHandler {
//make sure item is damaged and not destroyed
short dur = (short) toRepair.durabilityCurrent;
short max = toRepair.getDurabilityMax();
short max = (short) toRepair.template.item_health_full;
//account for durability modifications
float durMod = toRepair.getBonusPercent(ModType.Durability, SourceType.NONE);
max *= (1 + (durMod * 0.01f));