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/TntTile.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Minecraft.World/TntTile.cpp') diff --git a/Minecraft.World/TntTile.cpp b/Minecraft.World/TntTile.cpp index b422959c..5d47a2ac 100644 --- a/Minecraft.World/TntTile.cpp +++ b/Minecraft.World/TntTile.cpp @@ -53,13 +53,13 @@ void TntTile::wasExploded(Level *level, int x, int y, int z) { // 4J - added - don't every create on the client, I think this must be the cause of a bug reported in the java // version where white tnts are created in the network game - if (level->isClientSide) return; + if (level->isClientSide) return; // 4J - added condition to have finite limit of these // 4J-JEV: Fix for #90934 - Customer Encountered: TU11: Content: Gameplay: TNT blocks are triggered by explosions even though "TNT explodes" option is unchecked. if( level->newPrimedTntAllowed() && app.GetGameHostOption(eGameHostOption_TNT) ) { - shared_ptr primed = shared_ptr( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) ); + std::shared_ptr primed = std::shared_ptr( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) ); primed->life = level->random->nextInt(primed->life / 4) + primed->life / 8; level->addEntity(primed); } @@ -74,14 +74,14 @@ void TntTile::destroy(Level *level, int x, int y, int z, int data) // 4J - added condition to have finite limit of these if( level->newPrimedTntAllowed() && app.GetGameHostOption(eGameHostOption_TNT) ) { - shared_ptr tnt = shared_ptr( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) ); + std::shared_ptr tnt = std::shared_ptr( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) ); level->addEntity(tnt); level->playSound(tnt, eSoundType_RANDOM_FUSE, 1, 1.0f); } } } -bool TntTile::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 TntTile::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; if (player->getSelectedItem() != NULL && player->getSelectedItem()->id == Item::flintAndSteel_Id) @@ -93,12 +93,12 @@ bool TntTile::use(Level *level, int x, int y, int z, shared_ptr player, return Tile::use(level, x, y, z, player, clickedFace, clickX, clickY, clickZ); } -void TntTile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void TntTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { if (entity->GetType() == eTYPE_ARROW && !level->isClientSide) { // 4J Stu - Don't need to cast this - //shared_ptr arrow = dynamic_pointer_cast(entity); + //std::shared_ptr arrow = dynamic_pointer_cast(entity); if (entity->isOnFire()) { destroy(level, x, y, z, EXPLODE_BIT); @@ -107,12 +107,12 @@ void TntTile::entityInside(Level *level, int x, int y, int z, shared_ptr } } -shared_ptr TntTile::getSilkTouchItemInstance(int data) +std::shared_ptr TntTile::getSilkTouchItemInstance(int data) { return nullptr; } -void TntTile::registerIcons(IconRegister *iconRegister) +void TntTile::registerIcons(IconRegister *iconRegister) { icon = iconRegister->registerIcon(L"tnt_side"); iconTop = iconRegister->registerIcon(L"tnt_top"); -- cgit v1.2.3