From fbb6404cc8793f5caef374e1eda243fa2d159eb5 Mon Sep 17 00:00:00 2001 From: Howaner Date: Wed, 7 May 2014 20:43:37 +0200 Subject: Change m_RepairCost to int. --- src/UI/SlotArea.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/UI/SlotArea.cpp') diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index c4c95c7b1..13a9f9b92 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -866,7 +866,7 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player) m_MaximumCost = 0; m_StackSizeToBeUsedInRepair = 0; - UInt16 RepairCost = Input.m_RepairCost; + int RepairCost = Input.m_RepairCost; int NeedExp = 0; bool IsEnchantBook = false; if (!SecondInput.IsEmpty()) @@ -982,15 +982,9 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player) RepairCost = std::max(Input.m_RepairCost, SecondInput.m_RepairCost); if (!Input.m_CustomName.empty()) { - if (RepairCost < 9) - { - RepairCost = 0; - } - else - { - RepairCost -= 9; - } + RepairCost -= 9; } + RepairCost = std::max(RepairCost, 0); RepairCost += 2; Input.m_RepairCost = RepairCost; } -- cgit v1.2.3