diff options
Diffstat (limited to 'Minecraft.World/Minecart.cpp')
| -rw-r--r-- | Minecraft.World/Minecart.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
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<Entity> attacker = source->getDirectEntity(); - if (std::dynamic_pointer_cast<Player>(attacker) != NULL && - !std::dynamic_pointer_cast<Player>(attacker)->isAllowedToHurtEntity( shared_from_this() )) + if (dynamic_pointer_cast<Player>(attacker) != NULL && + !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 = std::dynamic_pointer_cast<Player>(source->getEntity()); + std::shared_ptr<Player> player = 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 = std::dynamic_pointer_cast<Container>( shared_from_this() ); + std::shared_ptr<Container> container = 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 = std::dynamic_pointer_cast<Minecart>(e); + std::shared_ptr<Minecart> cart = 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 (( 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 (( 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 (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 = std::dynamic_pointer_cast<Minecart>(e); + std::shared_ptr<Minecart> cart = 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 && std::dynamic_pointer_cast<Player>(rider.lock())!=NULL && rider.lock() != player) return true; + if (rider.lock() != NULL && 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( std::dynamic_pointer_cast<Container>( shared_from_this() ) ); + player->openContainer( dynamic_pointer_cast<Container>( shared_from_this() ) ); } else { |
