diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-05-07 20:43:37 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-05-07 20:43:37 +0200 |
commit | fbb6404cc8793f5caef374e1eda243fa2d159eb5 (patch) | |
tree | 447e21fdc8b384721d36881d06160b0dfe2c43ab /src/UI/SlotArea.cpp | |
parent | Where is the problem with clang? (diff) | |
download | cuberite-fbb6404cc8793f5caef374e1eda243fa2d159eb5.tar cuberite-fbb6404cc8793f5caef374e1eda243fa2d159eb5.tar.gz cuberite-fbb6404cc8793f5caef374e1eda243fa2d159eb5.tar.bz2 cuberite-fbb6404cc8793f5caef374e1eda243fa2d159eb5.tar.lz cuberite-fbb6404cc8793f5caef374e1eda243fa2d159eb5.tar.xz cuberite-fbb6404cc8793f5caef374e1eda243fa2d159eb5.tar.zst cuberite-fbb6404cc8793f5caef374e1eda243fa2d159eb5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/UI/SlotArea.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
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; } |