From eed75fd2fde79b1808ffcef8930f0e79bd07f81b Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 5 Jul 2024 20:57:45 -0500 Subject: [PATCH] repair costs calculated properly --- src/engine/net/client/ClientMessagePump.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index a3567552..14a02850 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -1660,12 +1660,8 @@ public class ClientMessagePump implements NetMsgHandler { DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return; } - //TODO get cost to repair - int cost = (int) ((max - dur) * 80.1); - cost *= npc.buyPercent; - - cost += npc.getRepairCost(); + int cost = (int)((toRepair.getMagicValue()/max*(max - dur)) + (npc.getRepairCost() * npc.buyPercent)); Building b = (!npc.isStatic()) ? npc.getBuilding() : null;