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/SlotArea.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/UI/SlotArea.cpp') diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index bb597b2c9..53d406e65 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -1059,7 +1059,7 @@ void cSlotAreaAnvil::OnTakeResult(cPlayer & a_Player) { SetSlot(1, a_Player, cItem()); } - m_ParentWindow.SetProperty(0, static_cast(m_MaximumCost), a_Player); + m_ParentWindow.SetProperty(0, static_cast(m_MaximumCost)); m_MaximumCost = 0; static_cast(m_ParentWindow).SetRepairedItemName("", nullptr); @@ -1135,7 +1135,7 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player) { Output.Empty(); SetSlot(2, a_Player, Output); - m_ParentWindow.SetProperty(0, 0, a_Player); + m_ParentWindow.SetProperty(0, 0); return; } @@ -1157,7 +1157,7 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player) // No enchantment Output.Empty(); SetSlot(2, a_Player, Output); - m_ParentWindow.SetProperty(0, 0, a_Player); + m_ParentWindow.SetProperty(0, 0); return; } @@ -1180,7 +1180,7 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player) // No enchantment Output.Empty(); SetSlot(2, a_Player, Output); - m_ParentWindow.SetProperty(0, 0, a_Player); + m_ParentWindow.SetProperty(0, 0); return; } @@ -1264,7 +1264,7 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player) } SetSlot(2, a_Player, Input); - m_ParentWindow.SetProperty(0, static_cast(m_MaximumCost), a_Player); + m_ParentWindow.SetProperty(0, static_cast(m_MaximumCost)); } @@ -1700,10 +1700,10 @@ void cSlotAreaEnchanting::UpdateResult(cPlayer & a_Player) // Properties set according to: https://wiki.vg/Protocol#Window_Property // Fake a "seed" for the client to draw Standard Galactic Alphabet glyphs: - m_ParentWindow.SetProperty(3, Random.RandInt(), a_Player); + m_ParentWindow.SetProperty(3, Random.RandInt()); // Calculate an enchanting possibility for each option (top, middle and bottom) and send details to window: - for (short i = 0; i != OptionLevels.size(); i++) + for (size_t i = 0; i != OptionLevels.size(); i++) { // A copy of the item. cItem EnchantedItem = Item.CopyOne(); @@ -1714,20 +1714,20 @@ void cSlotAreaEnchanting::UpdateResult(cPlayer & a_Player) LOGD("Generated enchanted item %d with enchantments: %s", i, EnchantedItem.m_Enchantments.ToString()); // Send the level requirement for the enchantment option: - m_ParentWindow.SetProperty(i, static_cast(OptionLevels[i]), a_Player); + m_ParentWindow.SetProperty(i, static_cast(OptionLevels[i])); // Get the first enchantment ID, which must exist: ASSERT(EnchantedItem.m_Enchantments.begin() != EnchantedItem.m_Enchantments.end()); const short EnchantmentID = static_cast(EnchantedItem.m_Enchantments.begin()->first); // Send the enchantment ID of the first enchantment on our item: - m_ParentWindow.SetProperty(4 + i, EnchantmentID, a_Player); + m_ParentWindow.SetProperty(4 + i, EnchantmentID); const short EnchantmentLevel = static_cast(EnchantedItem.m_Enchantments.GetLevel(EnchantmentID)); ASSERT(EnchantmentLevel > 0); // Send the level for the first enchantment on our item: - m_ParentWindow.SetProperty(7 + i, EnchantmentLevel, a_Player); + m_ParentWindow.SetProperty(7 + i, EnchantmentLevel); // Store the item we've enchanted as an option to be retrieved later: m_EnchantedItemOptions[i] = std::move(EnchantedItem); -- cgit v1.2.3