From 55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b Mon Sep 17 00:00:00 2001 From: void_17 <61356189+void2012@users.noreply.github.com> Date: Fri, 6 Mar 2026 02:11:18 +0700 Subject: Remove AUTO_VAR macro and _toString function (#592) --- Minecraft.World/LeashFenceKnotEntity.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Minecraft.World/LeashFenceKnotEntity.cpp') diff --git a/Minecraft.World/LeashFenceKnotEntity.cpp b/Minecraft.World/LeashFenceKnotEntity.cpp index 21f98a6a..55947d04 100644 --- a/Minecraft.World/LeashFenceKnotEntity.cpp +++ b/Minecraft.World/LeashFenceKnotEntity.cpp @@ -79,9 +79,9 @@ bool LeashFenceKnotEntity::interact(shared_ptr player) vector > *mobs = level->getEntitiesOfClass(typeid(Mob), AABB::newTemp(x - range, y - range, z - range, x + range, y + range, z + range)); if (mobs != NULL) { - for(AUTO_VAR(it, mobs->begin()); it != mobs->end(); ++it) + for(auto& it : *mobs) { - shared_ptr mob = dynamic_pointer_cast( *it ); + shared_ptr mob = dynamic_pointer_cast( it ); if (mob->isLeashed() && mob->getLeashHolder() == player) { mob->setLeashedTo(shared_from_this(), true); @@ -103,9 +103,9 @@ bool LeashFenceKnotEntity::interact(shared_ptr player) vector > *mobs = level->getEntitiesOfClass(typeid(Mob), AABB::newTemp(x - range, y - range, z - range, x + range, y + range, z + range)); if (mobs != NULL) { - for(AUTO_VAR(it, mobs->begin()); it != mobs->end(); ++it) + for(auto& it : *mobs) { - shared_ptr mob = dynamic_pointer_cast( *it ); + shared_ptr mob = dynamic_pointer_cast( it ); if (mob->isLeashed() && mob->getLeashHolder() == shared_from_this()) { mob->dropLeash(true, false); @@ -142,9 +142,9 @@ shared_ptr LeashFenceKnotEntity::findKnotAt(Level *level, vector > *knots = level->getEntitiesOfClass(typeid(LeashFenceKnotEntity), AABB::newTemp(x - 1.0, y - 1.0, z - 1.0, x + 1.0, y + 1.0, z + 1.0)); if (knots != NULL) { - for(AUTO_VAR(it, knots->begin()); it != knots->end(); ++it) - { - shared_ptr knot = dynamic_pointer_cast( *it ); + for (auto& it : *knots ) + { + shared_ptr knot = dynamic_pointer_cast( it ); if (knot->xTile == x && knot->yTile == y && knot->zTile == z) { delete knots; -- cgit v1.2.3