diff options
author | daniel0916 <theschokolps@gmail.com> | 2014-04-13 13:33:47 +0200 |
---|---|---|
committer | daniel0916 <theschokolps@gmail.com> | 2014-04-13 13:33:47 +0200 |
commit | 1429d2f1b1802e1be5f5551df890562b4a014342 (patch) | |
tree | c4a31ded4bfdf98d9e447439aa1eea695a5a2301 /src/ClientHandle.cpp | |
parent | Merge remote-tracking branch 'upstream/master' into Enchanting (diff) | |
download | cuberite-1429d2f1b1802e1be5f5551df890562b4a014342.tar cuberite-1429d2f1b1802e1be5f5551df890562b4a014342.tar.gz cuberite-1429d2f1b1802e1be5f5551df890562b4a014342.tar.bz2 cuberite-1429d2f1b1802e1be5f5551df890562b4a014342.tar.lz cuberite-1429d2f1b1802e1be5f5551df890562b4a014342.tar.xz cuberite-1429d2f1b1802e1be5f5551df890562b4a014342.tar.zst cuberite-1429d2f1b1802e1be5f5551df890562b4a014342.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ClientHandle.cpp | 9 |
1 files changed, 8 insertions, 1 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); + } } |