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/Boat.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Minecraft.World/Boat.cpp') 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) +AABB *Boat::getCollideAgainstBox(std::shared_ptr 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(source) != NULL) { - shared_ptr attacker = source->getDirectEntity(); + std::shared_ptr attacker = source->getDirectEntity(); - if (dynamic_pointer_cast(attacker) != NULL && + if (dynamic_pointer_cast(attacker) != NULL && !dynamic_pointer_cast(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 = dynamic_pointer_cast(source->getEntity()); + std::shared_ptr player = dynamic_pointer_cast(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 > *entities = level->getEntities(shared_from_this(), this->bb->grow(0.2f, 0, 0.2f)); + vector > *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 e = (*it); // entities->at(i); + std::shared_ptr 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) +bool Boat::interact(std::shared_ptr player) { if (rider.lock() != NULL && dynamic_pointer_cast(rider.lock())!=NULL && rider.lock() != player) return true; if (!level->isClientSide) -- cgit v1.2.3