summaryrefslogtreecommitdiffstats
path: root/src/UI/Window.cpp
diff options
context:
space:
mode:
authordaniel0916 <theschokolps@gmail.com>2014-04-17 13:15:35 +0200
committerdaniel0916 <theschokolps@gmail.com>2014-04-17 13:15:35 +0200
commitf9343a8490b50cb28a62c7327c0013da48ca2745 (patch)
tree7951063e6dd38b923d2ef91ae8a8db41628f42e7 /src/UI/Window.cpp
parentFixed conflicting enchantments checking (diff)
downloadcuberite-f9343a8490b50cb28a62c7327c0013da48ca2745.tar
cuberite-f9343a8490b50cb28a62c7327c0013da48ca2745.tar.gz
cuberite-f9343a8490b50cb28a62c7327c0013da48ca2745.tar.bz2
cuberite-f9343a8490b50cb28a62c7327c0013da48ca2745.tar.lz
cuberite-f9343a8490b50cb28a62c7327c0013da48ca2745.tar.xz
cuberite-f9343a8490b50cb28a62c7327c0013da48ca2745.tar.zst
cuberite-f9343a8490b50cb28a62c7327c0013da48ca2745.zip
Diffstat (limited to 'src/UI/Window.cpp')
-rw-r--r--src/UI/Window.cpp41
1 files changed, 3 insertions, 38 deletions
diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp
index c7b9b6aaf..fffe0e3fd 100644
--- a/src/UI/Window.cpp
+++ b/src/UI/Window.cpp
@@ -824,18 +824,7 @@ cEnchantingWindow::cEnchantingWindow(int a_BlockX, int a_BlockY, int a_BlockZ) :
void cEnchantingWindow::SetProperty(int a_Property, int a_Value)
{
- if (a_Property == 0)
- {
- m_PropertyValue0 = a_Value;
- }
- else if (a_Property == 1)
- {
- m_PropertyValue1 = a_Value;
- }
- else if (a_Property == 2)
- {
- m_PropertyValue2 = a_Value;
- }
+ m_PropertyValue[a_Property] = a_Value;
cCSLock Lock(m_CS);
for (cPlayerList::iterator itr = m_OpenedBy.begin(), end = m_OpenedBy.end(); itr != end; ++itr)
@@ -850,18 +839,7 @@ void cEnchantingWindow::SetProperty(int a_Property, int a_Value)
void cEnchantingWindow::SetProperty(int a_Property, int a_Value, cPlayer & a_Player)
{
- if (a_Property == 0)
- {
- m_PropertyValue0 = a_Value;
- }
- else if (a_Property == 1)
- {
- m_PropertyValue1 = a_Value;
- }
- else if (a_Property == 2)
- {
- m_PropertyValue2 = a_Value;
- }
+ m_PropertyValue[a_Property] = a_Value;
a_Player.GetClientHandle()->SendWindowProperty(*this, a_Property, a_Value);
}
@@ -872,20 +850,7 @@ void cEnchantingWindow::SetProperty(int a_Property, int a_Value, cPlayer & a_Pla
int cEnchantingWindow::GetPropertyValue(int a_Property)
{
- if (a_Property == 0)
- {
- return m_PropertyValue0;
- }
- else if (a_Property == 1)
- {
- return m_PropertyValue1;
- }
- else if (a_Property == 2)
- {
- return m_PropertyValue2;
- }
-
- return -1;
+ return m_PropertyValue[a_Property];
}