From 7ae0c13854d94ac2153cd3bb05ce18044b7cf8bb Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 17:36:56 +0700 Subject: Revert "dynamic_pointer_cast -> std::dynamic_pointer_cast" This reverts commit 07ad68bc156b3ab70401723bb074a29588ad3cb7. --- Minecraft.World/Minecart.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Minecraft.World/Minecart.cpp') diff --git a/Minecraft.World/Minecart.cpp b/Minecraft.World/Minecart.cpp index 5280eb4f..529629ff 100644 --- a/Minecraft.World/Minecart.cpp +++ b/Minecraft.World/Minecart.cpp @@ -187,8 +187,8 @@ bool Minecart::hurt(DamageSource *source, int hurtDamage) { std::shared_ptr attacker = source->getDirectEntity(); - if (std::dynamic_pointer_cast(attacker) != NULL && - !std::dynamic_pointer_cast(attacker)->isAllowedToHurtEntity( shared_from_this() )) + if (dynamic_pointer_cast(attacker) != NULL && + !dynamic_pointer_cast(attacker)->isAllowedToHurtEntity( shared_from_this() )) return false; } @@ -202,7 +202,7 @@ bool Minecart::hurt(DamageSource *source, int hurtDamage) if( rider.lock() != NULL && rider.lock() == source->getEntity() ) hurtDamage += 1; // 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 - std::shared_ptr player = std::dynamic_pointer_cast(source->getEntity()); + std::shared_ptr player = dynamic_pointer_cast(source->getEntity()); if (player != NULL && player->abilities.instabuild) this->setDamage(100); this->setDamage(getDamage() + (hurtDamage * 10)); @@ -215,7 +215,7 @@ bool Minecart::hurt(DamageSource *source, int hurtDamage) spawnAtLocation(Item::minecart->id, 1, 0); if (type == Minecart::CHEST) { - std::shared_ptr container = std::dynamic_pointer_cast( shared_from_this() ); + std::shared_ptr container = dynamic_pointer_cast( shared_from_this() ); for (unsigned int i = 0; i < container->getContainerSize(); i++) { std::shared_ptr item = container->getItem(i); @@ -678,7 +678,7 @@ void Minecart::tick() std::shared_ptr e = (*it); //entities->at(i); if (e != rider.lock() && e->isPushable() && e->GetType() == eTYPE_MINECART) { - std::shared_ptr cart = std::dynamic_pointer_cast(e); + std::shared_ptr cart = dynamic_pointer_cast(e); cart->m_bHasPushedCartThisTick = false; cart->push(shared_from_this()); @@ -905,7 +905,7 @@ void Minecart::push(std::shared_ptr e) if (level->isClientSide) return; if (e == rider.lock()) return; - if (( std::dynamic_pointer_cast(e)!=NULL) && std::dynamic_pointer_cast(e)==NULL && std::dynamic_pointer_cast(e) == NULL && type == Minecart::RIDEABLE && xd * xd + zd * zd > 0.01) + if (( dynamic_pointer_cast(e)!=NULL) && dynamic_pointer_cast(e)==NULL && dynamic_pointer_cast(e) == NULL && type == Minecart::RIDEABLE && xd * xd + zd * zd > 0.01) { if (rider.lock() == NULL && e->riding == NULL) { @@ -954,7 +954,7 @@ void Minecart::push(std::shared_ptr e) double xdd = (e->xd + xd); double zdd = (e->zd + zd); - std::shared_ptr cart = std::dynamic_pointer_cast(e); + std::shared_ptr cart = dynamic_pointer_cast(e); if (cart != NULL && cart->type == Minecart::FURNACE && type != Minecart::FURNACE) { xd *= 0.2f; @@ -1077,7 +1077,7 @@ bool Minecart::interact(std::shared_ptr player) { if (type == Minecart::RIDEABLE) { - if (rider.lock() != NULL && std::dynamic_pointer_cast(rider.lock())!=NULL && rider.lock() != player) return true; + if (rider.lock() != NULL && dynamic_pointer_cast(rider.lock())!=NULL && rider.lock() != player) return true; if (!level->isClientSide) { // 4J HEG - Fixed issue with player not being able to dismount minecart (issue #4455) @@ -1089,7 +1089,7 @@ bool Minecart::interact(std::shared_ptr player) if ( player->isAllowedToInteract(shared_from_this()) ) { if (!level->isClientSide) - player->openContainer( std::dynamic_pointer_cast( shared_from_this() ) ); + player->openContainer( dynamic_pointer_cast( shared_from_this() ) ); } else { -- cgit v1.2.3