aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Boat.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/Boat.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/Boat.cpp')
-rw-r--r--Minecraft.World/Boat.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Minecraft.World/Boat.cpp b/Minecraft.World/Boat.cpp
index 39211e44..26f02203 100644
--- a/Minecraft.World/Boat.cpp
+++ b/Minecraft.World/Boat.cpp
@@ -56,7 +56,7 @@ void Boat::defineSynchedData()
}
-AABB *Boat::getCollideAgainstBox(shared_ptr<Entity> entity)
+AABB *Boat::getCollideAgainstBox(std::shared_ptr<Entity> entity)
{
return entity->bb;
}
@@ -98,9 +98,9 @@ bool Boat::hurt(DamageSource *source, int hurtDamage)
// Untrusted players shouldn't be able to damage minecarts or boats.
if (dynamic_cast<EntityDamageSource *>(source) != NULL)
{
- shared_ptr<Entity> attacker = source->getDirectEntity();
+ std::shared_ptr<Entity> attacker = source->getDirectEntity();
- if (dynamic_pointer_cast<Player>(attacker) != NULL &&
+ if (dynamic_pointer_cast<Player>(attacker) != NULL &&
!dynamic_pointer_cast<Player>(attacker)->isAllowedToHurtEntity( shared_from_this() ))
return false;
}
@@ -117,7 +117,7 @@ bool Boat::hurt(DamageSource *source, int hurtDamage)
markHurt();
// 4J Stu - Brought froward from 12w36 to fix #46611 - TU5: Gameplay: Minecarts and boat requires more hits than one to be destroyed in creative mode
- shared_ptr<Player> player = dynamic_pointer_cast<Player>(source->getEntity());
+ std::shared_ptr<Player> player = dynamic_pointer_cast<Player>(source->getEntity());
if (player != NULL && player->abilities.instabuild) setDamage(100);
if (getDamage() > 20 * 2)
@@ -394,13 +394,13 @@ void Boat::tick()
if(level->isClientSide) return;
- vector<shared_ptr<Entity> > *entities = level->getEntities(shared_from_this(), this->bb->grow(0.2f, 0, 0.2f));
+ vector<std::shared_ptr<Entity> > *entities = level->getEntities(shared_from_this(), this->bb->grow(0.2f, 0, 0.2f));
if (entities != NULL && !entities->empty())
{
AUTO_VAR(itEnd, entities->end());
for (AUTO_VAR(it, entities->begin()); it != itEnd; it++)
{
- shared_ptr<Entity> e = (*it); // entities->at(i);
+ std::shared_ptr<Entity> e = (*it); // entities->at(i);
if (e != rider.lock() && e->isPushable() && e->GetType() == eTYPE_BOAT)
{
e->push(shared_from_this());
@@ -467,7 +467,7 @@ wstring Boat::getName()
return L"Boat";
}
-bool Boat::interact(shared_ptr<Player> player)
+bool Boat::interact(std::shared_ptr<Player> player)
{
if (rider.lock() != NULL && dynamic_pointer_cast<Player>(rider.lock())!=NULL && rider.lock() != player) return true;
if (!level->isClientSide)