aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/EnderMan.cpp
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
commit7074f35e4ba831e358117842b99ee35b87f85ae5 (patch)
tree7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.World/EnderMan.cpp
parentd63f79325f85e014361eb8cf1e41eaebedb1ae71 (diff)
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.
Diffstat (limited to 'Minecraft.World/EnderMan.cpp')
-rw-r--r--Minecraft.World/EnderMan.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Minecraft.World/EnderMan.cpp b/Minecraft.World/EnderMan.cpp
index abfc5cb5..e5995587 100644
--- a/Minecraft.World/EnderMan.cpp
+++ b/Minecraft.World/EnderMan.cpp
@@ -83,16 +83,16 @@ void EnderMan::readAdditionalSaveData(CompoundTag *tag)
setCarryingData(tag->getShort(L"carryingData"));
}
-shared_ptr<Entity> EnderMan::findAttackTarget()
+std::shared_ptr<Entity> EnderMan::findAttackTarget()
{
#ifndef _FINAL_BUILD
if(app.GetMobsDontAttackEnabled())
{
- return shared_ptr<Player>();
+ return std::shared_ptr<Player>();
}
#endif
- shared_ptr<Player> player = level->getNearestAttackablePlayer(shared_from_this(), 64);
+ std::shared_ptr<Player> player = level->getNearestAttackablePlayer(shared_from_this(), 64);
if (player != NULL)
{
if (isLookingAtMe(player))
@@ -112,9 +112,9 @@ shared_ptr<Entity> EnderMan::findAttackTarget()
return nullptr;
}
-bool EnderMan::isLookingAtMe(shared_ptr<Player> player)
+bool EnderMan::isLookingAtMe(std::shared_ptr<Player> player)
{
- shared_ptr<ItemInstance> helmet = player->inventory->armor[3];
+ std::shared_ptr<ItemInstance> helmet = player->inventory->armor[3];
if (helmet != NULL && helmet->id == Tile::pumpkin_Id) return false;
Vec3 *look = player->getViewVector(1)->normalize();
@@ -250,7 +250,7 @@ bool EnderMan::teleport()
return teleport(xx, yy, zz);
}
-bool EnderMan::teleportTowards(shared_ptr<Entity> e)
+bool EnderMan::teleportTowards(std::shared_ptr<Entity> e)
{
Vec3 *dir = Vec3::newTemp(x - e->x, bb->y0 + bbHeight / 2 - e->y + e->getHeadHeight(), z - e->z);
dir = dir->normalize();