diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-05-01 01:25:04 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-05-05 17:34:24 +0200 |
commit | 6ac332cd0662f49e30f60ae0b5a3b7f85df8cfb3 (patch) | |
tree | 06e89343c2e64b757b47862f4eb2e5f4bf37dde9 /src/UI/SlotArea.cpp | |
parent | Add anvil window and slot area. (diff) | |
download | cuberite-6ac332cd0662f49e30f60ae0b5a3b7f85df8cfb3.tar cuberite-6ac332cd0662f49e30f60ae0b5a3b7f85df8cfb3.tar.gz cuberite-6ac332cd0662f49e30f60ae0b5a3b7f85df8cfb3.tar.bz2 cuberite-6ac332cd0662f49e30f60ae0b5a3b7f85df8cfb3.tar.lz cuberite-6ac332cd0662f49e30f60ae0b5a3b7f85df8cfb3.tar.xz cuberite-6ac332cd0662f49e30f60ae0b5a3b7f85df8cfb3.tar.zst cuberite-6ac332cd0662f49e30f60ae0b5a3b7f85df8cfb3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/UI/SlotArea.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index eac8257ec..2941982a7 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -600,8 +600,7 @@ cCraftingRecipe & cSlotAreaCrafting::GetRecipeForPlayer(cPlayer & a_Player) cSlotAreaAnvil::cSlotAreaAnvil(cAnvilWindow & a_ParentWindow) : cSlotAreaTemporary(3, a_ParentWindow), - m_MaximumCost(0), - m_RepairedItemName("") + m_MaximumCost(0) { } @@ -705,7 +704,8 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player) } int NameChangeExp = 0; - if (m_RepairedItemName.empty()) + const AString & RepairedItemName = ((cAnvilWindow*)&m_ParentWindow)->GetRepairedItemName(); + if (RepairedItemName.empty()) { // Remove custom name if (!Input.m_CustomName.empty()) @@ -715,7 +715,7 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player) Input.m_CustomName = ""; } } - else if (m_RepairedItemName != Input.m_CustomName) + else if (RepairedItemName != Input.m_CustomName) { // Change custom name NameChangeExp = (Input.IsDamageable()) ? 4 : (Input.m_ItemCount * 5); @@ -726,7 +726,7 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player) RepairCost += NameChangeExp / 2; } - Input.m_CustomName = m_RepairedItemName; + Input.m_CustomName = RepairedItemName; } // TODO: Add enchantment exp cost. |