summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaniel0916 <theschokolps@gmail.com>2014-04-13 22:15:10 +0200
committerdaniel0916 <theschokolps@gmail.com>2014-04-13 22:15:10 +0200
commitfce9ea65c35ab7f94c23bb361386b5ce223279eb (patch)
treea9db15d5c27c053bb886482199ffdfb21df7222e
parentFixed mistake (diff)
downloadcuberite-fce9ea65c35ab7f94c23bb361386b5ce223279eb.tar
cuberite-fce9ea65c35ab7f94c23bb361386b5ce223279eb.tar.gz
cuberite-fce9ea65c35ab7f94c23bb361386b5ce223279eb.tar.bz2
cuberite-fce9ea65c35ab7f94c23bb361386b5ce223279eb.tar.lz
cuberite-fce9ea65c35ab7f94c23bb361386b5ce223279eb.tar.xz
cuberite-fce9ea65c35ab7f94c23bb361386b5ce223279eb.tar.zst
cuberite-fce9ea65c35ab7f94c23bb361386b5ce223279eb.zip
-rw-r--r--src/ClientHandle.cpp4
-rw-r--r--src/ClientHandle.h1
-rw-r--r--src/UI/SlotArea.cpp2
-rw-r--r--src/UI/Window.h2
4 files changed, 8 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 96afff5bc..2dd9cb91e 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -3115,7 +3115,9 @@ void cClientHandle::HandleEnchantItem(Byte & WindowID, Byte & Enchantment)
if (m_Player->DeltaExperience(-m_Player->XpForLevel(Window->GetPropertyValue(Enchantment))) >= 0 || m_Player->IsGameModeCreative())
{
- m_Player->GetWindow()->SetSlot(*m_Player, 0, Item);
+ Window->m_SlotArea->SetSlot(0, *m_Player, Item);
+ Window->SendSlot(*m_Player, Window->m_SlotArea, 0);
+ Window->BroadcastWholeWindow();
Window->SetProperty(0, 0, *m_Player);
Window->SetProperty(1, 0, *m_Player);
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index 4c88d79e2..b4b1d0da3 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -19,6 +19,7 @@
#include "Scoreboard.h"
#include "Map.h"
#include "Enchantments.h"
+#include "UI/SlotArea.h"
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index 352558d9e..35230cffb 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -600,6 +600,8 @@ cCraftingRecipe & cSlotAreaCrafting::GetRecipeForPlayer(cPlayer & a_Player)
cSlotAreaEnchanting::cSlotAreaEnchanting(int a_NumSlots, cWindow & a_ParentWindow) :
cSlotAreaTemporary(a_NumSlots, a_ParentWindow)
{
+ cEnchantingWindow * Window = (cEnchantingWindow *)&m_ParentWindow;
+ Window->m_SlotArea = this;
}
diff --git a/src/UI/Window.h b/src/UI/Window.h
index 52ab6c3ae..5e799248c 100644
--- a/src/UI/Window.h
+++ b/src/UI/Window.h
@@ -246,6 +246,8 @@ public:
/** Set the Position Values to the Position of the Enchantment Table */
void GetBlockPos(int & a_PosX, int & a_PosY, int & a_PosZ);
+ cSlotArea * m_SlotArea;
+
protected:
int m_PropertyValue0, m_PropertyValue1, m_PropertyValue2;
int m_BlockX, m_BlockY, m_BlockZ;