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.
This commit is contained in:
void_17
2026-03-02 15:58:20 +07:00
parent d63f79325f
commit 7074f35e4b
1373 changed files with 12054 additions and 12054 deletions

View File

@@ -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<PrimedTnt> primed = shared_ptr<PrimedTnt>( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) );
std::shared_ptr<PrimedTnt> primed = std::shared_ptr<PrimedTnt>( 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<PrimedTnt> tnt = shared_ptr<PrimedTnt>( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) );
std::shared_ptr<PrimedTnt> tnt = std::shared_ptr<PrimedTnt>( 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> 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> 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> 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> entity)
void TntTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr<Entity> entity)
{
if (entity->GetType() == eTYPE_ARROW && !level->isClientSide)
{
// 4J Stu - Don't need to cast this
//shared_ptr<Arrow> arrow = dynamic_pointer_cast<Arrow>(entity);
//std::shared_ptr<Arrow> arrow = dynamic_pointer_cast<Arrow>(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<Entity>
}
}
shared_ptr<ItemInstance> TntTile::getSilkTouchItemInstance(int data)
std::shared_ptr<ItemInstance> 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");