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

@@ -116,7 +116,7 @@ void Slime::tick()
level->addParticle(getParticleName(), x + xd, bb->y0, z + zd, 0, 0, 0);
}
if (doPlayLandSound())
if (doPlayLandSound())
{
level->playSound(shared_from_this(), getSquishSound(), getSoundVolume(), ((random->nextFloat() - random->nextFloat()) * 0.2f + 1.0f) / 0.8f);
}
@@ -130,15 +130,15 @@ void Slime::tick()
decreaseSquish();
}
void Slime::serverAiStep()
void Slime::serverAiStep()
{
checkDespawn();
shared_ptr<Player> player = level->getNearestAttackablePlayer(shared_from_this(), 16);
std::shared_ptr<Player> player = level->getNearestAttackablePlayer(shared_from_this(), 16);
if (player != NULL)
{
lookAt(player, 10, 20);
}
if (onGround && jumpDelay-- <= 0)
if (onGround && jumpDelay-- <= 0)
{
jumpDelay = getJumpDelay();
if (player != NULL)
@@ -155,7 +155,7 @@ void Slime::serverAiStep()
//targetSquish = 1;
xxa = 1 - random->nextFloat() * 2;
yya = (float) 1 * getSize();
}
}
else
{
jumping = false;
@@ -176,9 +176,9 @@ int Slime::getJumpDelay()
return random->nextInt(20) + 10;
}
shared_ptr<Slime> Slime::createChild()
std::shared_ptr<Slime> Slime::createChild()
{
return shared_ptr<Slime>( new Slime(level) );
return std::shared_ptr<Slime>( new Slime(level) );
}
void Slime::remove()
@@ -196,7 +196,7 @@ void Slime::remove()
{
float xd = (i % 2 - 0.5f) * size / 4.0f;
float zd = (i / 2 - 0.5f) * size / 4.0f;
shared_ptr<Slime> slime = createChild();
std::shared_ptr<Slime> slime = createChild();
slime->setSize(size / 2);
slime->moveTo(x + xd, y + 0.5, z + zd, random->nextFloat() * 360, 0);
level->addEntity(slime);
@@ -206,7 +206,7 @@ void Slime::remove()
Mob::remove();
}
void Slime::playerTouch(shared_ptr<Player> player)
void Slime::playerTouch(std::shared_ptr<Player> player)
{
if (isDealsDamage())
{
@@ -233,7 +233,7 @@ int Slime::getAttackDamage()
return getSize();
}
int Slime::getHurtSound()
int Slime::getHurtSound()
{
return eSoundType_MOB_SLIME;
}
@@ -266,7 +266,7 @@ bool Slime::canSpawn()
return false;
}
float Slime::getSoundVolume()
float Slime::getSoundVolume()
{
return 0.4f * getSize();
}