aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Minecart.cpp
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 17:10:34 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 17:10:34 +0700
commit07ad68bc156b3ab70401723bb074a29588ad3cb7 (patch)
treefcd5c35bb393920e46af6c9b643d0544e78b5ab8 /Minecraft.World/Minecart.cpp
parent7bee4770df1540c2daf3121c0790332fb41e72dd (diff)
dynamic_pointer_cast -> std::dynamic_pointer_cast
Diffstat (limited to 'Minecraft.World/Minecart.cpp')
-rw-r--r--Minecraft.World/Minecart.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Minecraft.World/Minecart.cpp b/Minecraft.World/Minecart.cpp
index 529629ff..5280eb4f 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<Entity> attacker = source->getDirectEntity();
- if (dynamic_pointer_cast<Player>(attacker) != NULL &&
- !dynamic_pointer_cast<Player>(attacker)->isAllowedToHurtEntity( shared_from_this() ))
+ if (std::dynamic_pointer_cast<Player>(attacker) != NULL &&
+ !std::dynamic_pointer_cast<Player>(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> player = dynamic_pointer_cast<Player>(source->getEntity());
+ std::shared_ptr<Player> player = std::dynamic_pointer_cast<Player>(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> container = dynamic_pointer_cast<Container>( shared_from_this() );
+ std::shared_ptr<Container> container = std::dynamic_pointer_cast<Container>( shared_from_this() );
for (unsigned int i = 0; i < container->getContainerSize(); i++)
{
std::shared_ptr<ItemInstance> item = container->getItem(i);
@@ -678,7 +678,7 @@ void Minecart::tick()
std::shared_ptr<Entity> e = (*it); //entities->at(i);
if (e != rider.lock() && e->isPushable() && e->GetType() == eTYPE_MINECART)
{
- std::shared_ptr<Minecart> cart = dynamic_pointer_cast<Minecart>(e);
+ std::shared_ptr<Minecart> cart = std::dynamic_pointer_cast<Minecart>(e);
cart->m_bHasPushedCartThisTick = false;
cart->push(shared_from_this());
@@ -905,7 +905,7 @@ void Minecart::push(std::shared_ptr<Entity> e)
if (level->isClientSide) return;
if (e == rider.lock()) return;
- if (( dynamic_pointer_cast<Mob>(e)!=NULL) && dynamic_pointer_cast<Player>(e)==NULL && dynamic_pointer_cast<VillagerGolem>(e) == NULL && type == Minecart::RIDEABLE && xd * xd + zd * zd > 0.01)
+ if (( std::dynamic_pointer_cast<Mob>(e)!=NULL) && std::dynamic_pointer_cast<Player>(e)==NULL && std::dynamic_pointer_cast<VillagerGolem>(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<Entity> e)
double xdd = (e->xd + xd);
double zdd = (e->zd + zd);
- std::shared_ptr<Minecart> cart = dynamic_pointer_cast<Minecart>(e);
+ std::shared_ptr<Minecart> cart = std::dynamic_pointer_cast<Minecart>(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> player)
{
if (type == Minecart::RIDEABLE)
{
- if (rider.lock() != NULL && dynamic_pointer_cast<Player>(rider.lock())!=NULL && rider.lock() != player) return true;
+ if (rider.lock() != NULL && std::dynamic_pointer_cast<Player>(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> player)
if ( player->isAllowedToInteract(shared_from_this()) )
{
if (!level->isClientSide)
- player->openContainer( dynamic_pointer_cast<Container>( shared_from_this() ) );
+ player->openContainer( std::dynamic_pointer_cast<Container>( shared_from_this() ) );
}
else
{