From 7074f35e4ba831e358117842b99ee35b87f85ae5 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 15:58:20 +0700 Subject: shared_ptr -> std::shared_ptr This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today. --- Minecraft.World/CauldronTile.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Minecraft.World/CauldronTile.cpp') diff --git a/Minecraft.World/CauldronTile.cpp b/Minecraft.World/CauldronTile.cpp index 4d5640ca..1ff5d9b0 100644 --- a/Minecraft.World/CauldronTile.cpp +++ b/Minecraft.World/CauldronTile.cpp @@ -46,7 +46,7 @@ Icon *CauldronTile::getTexture(const wstring &name) return NULL; } -void CauldronTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void CauldronTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { setShape(0, 0, 0, 1, 5.0f / 16.0f, 1); Tile::addAABBs(level, x, y, z, box, boxes, source); @@ -83,7 +83,7 @@ bool CauldronTile::isCubeShaped() return false; } -bool CauldronTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool CauldronTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if(soundOnly) return false; @@ -92,7 +92,7 @@ bool CauldronTile::use(Level *level, int x, int y, int z, shared_ptr pla return true; } - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); if (item == NULL) { return true; @@ -106,7 +106,7 @@ bool CauldronTile::use(Level *level, int x, int y, int z, shared_ptr pla { if (!player->abilities.instabuild) { - player->inventory->setItem(player->inventory->selected, shared_ptr(new ItemInstance(Item::bucket_empty))); + player->inventory->setItem(player->inventory->selected, std::shared_ptr(new ItemInstance(Item::bucket_empty))); } level->setData(x, y, z, 3); @@ -117,10 +117,10 @@ bool CauldronTile::use(Level *level, int x, int y, int z, shared_ptr pla { if (currentData > 0) { - shared_ptr potion = shared_ptr(new ItemInstance(Item::potion, 1, 0)); + std::shared_ptr potion = std::shared_ptr(new ItemInstance(Item::potion, 1, 0)); if (!player->inventory->add(potion)) { - level->addEntity(shared_ptr(new ItemEntity(level, x + 0.5, y + 1.5, z + 0.5, potion))); + level->addEntity(std::shared_ptr(new ItemEntity(level, x + 0.5, y + 1.5, z + 0.5, potion))); } // 4J Stu - Brought forward change to update inventory when filling bottles with water else if (dynamic_pointer_cast( player ) != NULL) -- cgit v1.2.3