From 1429d2f1b1802e1be5f5551df890562b4a014342 Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Sun, 13 Apr 2014 13:33:47 +0200 Subject: Some Fixes --- src/ClientHandle.cpp | 9 ++++++++- src/UI/SlotArea.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 90165b432..2d068ea07 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -3107,7 +3107,14 @@ void cClientHandle::HandleEnchantItem(Byte & WindowID, Byte & Enchantment) Item.m_Enchantments.AddFromString(Enchantment3.ToString()); enchantments.erase(std::remove(enchantments.begin(), enchantments.end(), Enchantment3), enchantments.end()); - m_Player->GetWindow()->SetSlot(*m_Player, 0, Item); + if (m_Player->DeltaExperience(Window->GetPropertyValue(Enchantment)) >= 0 || m_Player->IsGameModeCreative()) + { + m_Player->GetWindow()->SetSlot(*m_Player, 0, Item); + + Window->SetProperty(0, 0, *m_Player); + Window->SetProperty(1, 0, *m_Player); + Window->SetProperty(2, 0, *m_Player); + } } diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index d43b91700..352558d9e 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -647,7 +647,7 @@ void cSlotAreaEnchanting::ClickedResult(cPlayer & a_Player) m_ParentWindow.SetProperty(1, 0, a_Player); m_ParentWindow.SetProperty(2, 0, a_Player); } - else if (a_Player.GetDraggingItem().IsEnchantable) + else if (cItem::IsEnchantable(a_Player.GetDraggingItem().m_ItemType)) { int PosX = 0; int PosY = 0; -- cgit v1.2.3