Browse Source

repair costs calculated properly

lakebane-new
FatBoy-DOTC 4 months ago
parent
commit
eed75fd2fd
  1. 6
      src/engine/net/client/ClientMessagePump.java

6
src/engine/net/client/ClientMessagePump.java

@ -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;

Loading…
Cancel
Save