repair costs calculated properly

This commit is contained in:
2024-07-05 20:57:45 -05:00
parent 6374390b34
commit eed75fd2fd
+1 -5
View File
@@ -1660,12 +1660,8 @@ public class ClientMessagePump implements NetMsgHandler {
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return; return;
} }
//TODO get cost to repair
int cost = (int) ((max - dur) * 80.1);
cost *= npc.buyPercent; int cost = (int)((toRepair.getMagicValue()/max*(max - dur)) + (npc.getRepairCost() * npc.buyPercent));
cost += npc.getRepairCost();
Building b = (!npc.isStatic()) ? npc.getBuilding() : null; Building b = (!npc.isStatic()) ? npc.getBuilding() : null;