summaryrefslogtreecommitdiffstats
path: root/src/UI/EnchantingWindow.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-10-02 15:22:17 +0200
committerpeterbell10 <peterbell10@live.co.uk>2020-10-03 17:54:14 +0200
commit21068011c6d8a4794eec86794d6b9612a265f03a (patch)
treef8c6bf1d8760a02945c0622ff2d237ff3b737030 /src/UI/EnchantingWindow.cpp
parentFix instant mining of blocks not being recognised, tweak anti-cheat (#4938) (diff)
downloadcuberite-21068011c6d8a4794eec86794d6b9612a265f03a.tar
cuberite-21068011c6d8a4794eec86794d6b9612a265f03a.tar.gz
cuberite-21068011c6d8a4794eec86794d6b9612a265f03a.tar.bz2
cuberite-21068011c6d8a4794eec86794d6b9612a265f03a.tar.lz
cuberite-21068011c6d8a4794eec86794d6b9612a265f03a.tar.xz
cuberite-21068011c6d8a4794eec86794d6b9612a265f03a.tar.zst
cuberite-21068011c6d8a4794eec86794d6b9612a265f03a.zip
Diffstat (limited to 'src/UI/EnchantingWindow.cpp')
-rw-r--r--src/UI/EnchantingWindow.cpp29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/UI/EnchantingWindow.cpp b/src/UI/EnchantingWindow.cpp
index 15d27fc63..9ebb70f32 100644
--- a/src/UI/EnchantingWindow.cpp
+++ b/src/UI/EnchantingWindow.cpp
@@ -26,25 +26,9 @@ cEnchantingWindow::cEnchantingWindow(Vector3i a_BlockPos, const AString & a_Titl
-void cEnchantingWindow::SetProperty(short a_Property, short a_Value, cPlayer & a_Player)
+void cEnchantingWindow::SetProperty(size_t a_Property, short a_Value)
{
- ASSERT(a_Property >= 0);
- if (static_cast<size_t>(a_Property) < m_PropertyValue.size())
- {
- m_PropertyValue[a_Property] = a_Value;
- }
-
- Super::SetProperty(a_Property, a_Value, a_Player);
-}
-
-
-
-
-
-void cEnchantingWindow::SetProperty(short a_Property, short a_Value)
-{
- ASSERT(a_Property >= 0);
- if (static_cast<size_t>(a_Property) < m_PropertyValue.size())
+ if (a_Property < m_PropertyValue.size())
{
m_PropertyValue[a_Property] = a_Value;
}
@@ -56,14 +40,9 @@ void cEnchantingWindow::SetProperty(short a_Property, short a_Value)
-short cEnchantingWindow::GetProperty(short a_Property)
+short cEnchantingWindow::GetProperty(size_t a_Property)
{
- if ((a_Property < 0) || (static_cast<size_t>(a_Property) >= m_PropertyValue.size()))
- {
- ASSERT(!"a_Property is invalid");
- return 0;
- }
-
+ ASSERT(a_Property < m_PropertyValue.size());
return m_PropertyValue[a_Property];
}