aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/RepairMenu.cpp
diff options
context:
space:
mode:
authorvoid_17 <61356189+void2012@users.noreply.github.com>2026-03-06 02:11:18 +0700
committerGitHub <noreply@github.com>2026-03-06 02:11:18 +0700
commit55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b (patch)
tree953c537a5c66e328e9f4ab29626cf738112d53c0 /Minecraft.World/RepairMenu.cpp
parent7d6658fe5b3095f35093701b5ab669ffc291e875 (diff)
Remove AUTO_VAR macro and _toString function (#592)
Diffstat (limited to 'Minecraft.World/RepairMenu.cpp')
-rw-r--r--Minecraft.World/RepairMenu.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/RepairMenu.cpp b/Minecraft.World/RepairMenu.cpp
index d246b73f..a4c48edf 100644
--- a/Minecraft.World/RepairMenu.cpp
+++ b/Minecraft.World/RepairMenu.cpp
@@ -134,22 +134,22 @@ void RepairMenu::createResult()
unordered_map<int, int> *additionalEnchantments = EnchantmentHelper::getEnchantments(addition);
- for(AUTO_VAR(it, additionalEnchantments->begin()); it != additionalEnchantments->end(); ++it)
+ for(auto& it : *additionalEnchantments)
{
- int id = it->first;
+ int id = it.first;
Enchantment *enchantment = Enchantment::enchantments[id];
- AUTO_VAR(localIt, enchantments->find(id));
- int current = localIt != enchantments->end() ? localIt->second : 0;
- int level = it->second;
+ auto localIt = enchantments->find(id);
+ int current = localIt != enchantments->end() ? localIt->second : 0;
+ int level = it.second;
level = (current == level) ? level += 1 : max(level, current);
int extra = level - current;
bool compatible = enchantment->canEnchant(input);
if (player->abilities.instabuild) compatible = true;
- for(AUTO_VAR(it2, enchantments->begin()); it2 != enchantments->end(); ++it2)
+ for(auto& it2 : *enchantments)
{
- int other = it2->first;
+ int other = it2.first;
if (other != id && !enchantment->isCompatibleWith(Enchantment::enchantments[other]))
{
compatible = false;
@@ -219,11 +219,11 @@ void RepairMenu::createResult()
}
int count = 0;
- for(AUTO_VAR(it, enchantments->begin()); it != enchantments->end(); ++it)
+ for(auto& it : *enchantments)
{
- int id = it->first;
+ int id = it.first;
Enchantment *enchantment = Enchantment::enchantments[id];
- int level = it->second;
+ int level = it.second;
int fee = 0;
count++;