From 07ad68bc156b3ab70401723bb074a29588ad3cb7 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 17:10:34 +0700 Subject: dynamic_pointer_cast -> std::dynamic_pointer_cast --- Minecraft.World/ChestTile.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Minecraft.World/ChestTile.cpp') diff --git a/Minecraft.World/ChestTile.cpp b/Minecraft.World/ChestTile.cpp index 9c462713..bb3256b5 100644 --- a/Minecraft.World/ChestTile.cpp +++ b/Minecraft.World/ChestTile.cpp @@ -200,13 +200,13 @@ bool ChestTile::isFullChest(Level *level, int x, int y, int z) void ChestTile::neighborChanged(Level *level, int x, int y, int z, int type) { EntityTile::neighborChanged(level, x, y, z, type); - std::shared_ptr(cte) = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + std::shared_ptr(cte) = std::dynamic_pointer_cast(level->getTileEntity(x, y, z)); if (cte != NULL) cte->clearCache(); } void ChestTile::onRemove(Level *level, int x, int y, int z, int id, int data) { - std::shared_ptr container = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr container = std::dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if (container != NULL ) { for (unsigned int i = 0; i < container->getContainerSize(); i++) @@ -263,7 +263,7 @@ bool ChestTile::use(Level *level, int x, int y, int z, std::shared_ptr p return true; } - std::shared_ptr container = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr container = std::dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if (container == NULL) return true; if (level->isSolidBlockingTile(x, y + 1, z)) return true; @@ -274,10 +274,10 @@ bool ChestTile::use(Level *level, int x, int y, int z, std::shared_ptr p if (level->getTile(x, y, z - 1) == id && (level->isSolidBlockingTile(x, y + 1, z - 1) || isCatSittingOnChest(level, x, y, z - 1))) return true; if (level->getTile(x, y, z + 1) == id && (level->isSolidBlockingTile(x, y + 1, z + 1) || isCatSittingOnChest(level, x, y, z + 1))) return true; - if (level->getTile(x - 1, y, z) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, dynamic_pointer_cast( level->getTileEntity(x - 1, y, z) ), container) ); - if (level->getTile(x + 1, y, z) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, container, dynamic_pointer_cast( level->getTileEntity(x + 1, y, z) )) ); - if (level->getTile(x, y, z - 1) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, dynamic_pointer_cast( level->getTileEntity(x, y, z - 1) ), container) ); - if (level->getTile(x, y, z + 1) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, container, dynamic_pointer_cast( level->getTileEntity(x, y, z + 1) )) ); + if (level->getTile(x - 1, y, z) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, std::dynamic_pointer_cast( level->getTileEntity(x - 1, y, z) ), container) ); + if (level->getTile(x + 1, y, z) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, container, std::dynamic_pointer_cast( level->getTileEntity(x + 1, y, z) )) ); + if (level->getTile(x, y, z - 1) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, std::dynamic_pointer_cast( level->getTileEntity(x, y, z - 1) ), container) ); + if (level->getTile(x, y, z + 1) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, container, std::dynamic_pointer_cast( level->getTileEntity(x, y, z + 1) )) ); player->openContainer(container); @@ -290,7 +290,7 @@ bool ChestTile::isCatSittingOnChest(Level *level, int x, int y, int z) vector > *entities = level->getEntitiesOfClass(typeid(Ozelot), AABB::newTemp(x, y + 1, z, x + 1, y + 2, z + 1)); for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { - std::shared_ptr ocelot = dynamic_pointer_cast(*it); + std::shared_ptr ocelot = std::dynamic_pointer_cast(*it); if(ocelot->isSitting()) { return true; -- cgit v1.2.3