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/ChestTile.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Minecraft.World/ChestTile.cpp') diff --git a/Minecraft.World/ChestTile.cpp b/Minecraft.World/ChestTile.cpp index a4894c86..11178b8a 100644 --- a/Minecraft.World/ChestTile.cpp +++ b/Minecraft.World/ChestTile.cpp @@ -337,16 +337,19 @@ int ChestTile::getDirectSignal(LevelSource *level, int x, int y, int z, int dir) bool ChestTile::isCatSittingOnChest(Level *level, int x, int y, int z) { vector > *entities = level->getEntitiesOfClass(typeid(Ocelot), AABB::newTemp(x, y + 1, z, x + 1, y + 2, z + 1)); - for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) + if ( entities ) { - shared_ptr ocelot = dynamic_pointer_cast(*it); - if(ocelot->isSitting()) + for (auto& it : *entities) { - delete entities; - return true; + shared_ptr ocelot = dynamic_pointer_cast(it); + if ( ocelot && ocelot->isSitting()) + { + delete entities; + return true; + } } + delete entities; } - delete entities; return false; } -- cgit v1.2.3