From 21068011c6d8a4794eec86794d6b9612a265f03a Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 2 Oct 2020 14:22:17 +0100 Subject: Remove SetProperty(...cPlayer) Enchantment table, anvil windows are already opened one per-player. --- src/UI/EnchantingWindow.cpp | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'src/UI/EnchantingWindow.cpp') 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(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(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(a_Property) >= m_PropertyValue.size())) - { - ASSERT(!"a_Property is invalid"); - return 0; - } - + ASSERT(a_Property < m_PropertyValue.size()); return m_PropertyValue[a_Property]; } -- cgit v1.2.3