From 07ad68bc156b3ab70401723bb074a29588ad3cb7 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 17:10:34 +0700 Subject: dynamic_pointer_cast -> std::dynamic_pointer_cast --- Minecraft.Client/Minecraft.cpp | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'Minecraft.Client/Minecraft.cpp') diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 3ff38dfa..3703da9d 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -2810,7 +2810,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { default: { - std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = std::dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem)) { @@ -2839,7 +2839,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; default: { - std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = std::dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem)) { @@ -2870,13 +2870,13 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) case Item::shears_Id: { if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT; - std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = std::dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby()) *piUse=IDS_TOOLTIPS_SHEAR; } break; default: { - std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = std::dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem)) { @@ -2898,7 +2898,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) *piAction=IDS_TOOLTIPS_MINE; // are we in the boat already? - if (dynamic_pointer_cast( player->riding ) != NULL) + if (std::dynamic_pointer_cast( player->riding ) != NULL) { *piUse=IDS_TOOLTIPS_EXIT; } @@ -2910,13 +2910,13 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) case eTYPE_MINECART: *piAction=IDS_TOOLTIPS_MINE; // are we in the minecart already? - if (dynamic_pointer_cast( player->riding ) != NULL) + if (std::dynamic_pointer_cast( player->riding ) != NULL) { *piUse=IDS_TOOLTIPS_EXIT; } else { - switch(dynamic_pointer_cast(hitResult->entity)->type) + switch(std::dynamic_pointer_cast(hitResult->entity)->type) { case Minecart::RIDEABLE: *piUse=IDS_TOOLTIPS_RIDE; @@ -2958,7 +2958,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { case Item::dye_powder_Id: { - std::shared_ptr sheep = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr sheep = std::dynamic_pointer_cast(hitResult->entity); // convert to tile-based color value (0 is white instead of black) int newColor = ClothTile::getTileDataForItemAuxValue(heldItem->getAuxValue()); @@ -2971,7 +2971,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; case Item::shears_Id: { - std::shared_ptr sheep = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr sheep = std::dynamic_pointer_cast(hitResult->entity); // can only shear a sheep that hasn't been sheared if(!sheep->isSheared() ) @@ -2983,7 +2983,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; default: { - std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = std::dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem)) { @@ -2998,18 +2998,18 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) case eTYPE_PIG: // can ride a pig if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT; - if (dynamic_pointer_cast( player->riding ) != NULL) + if (std::dynamic_pointer_cast( player->riding ) != NULL) { *piUse=IDS_TOOLTIPS_EXIT; } else { // does the pig have a saddle? - if(dynamic_pointer_cast(hitResult->entity)->hasSaddle()) + if(std::dynamic_pointer_cast(hitResult->entity)->hasSaddle()) { *piUse=IDS_TOOLTIPS_RIDE; } - else if (!dynamic_pointer_cast(hitResult->entity)->isBaby()) + else if (!std::dynamic_pointer_cast(hitResult->entity)->isBaby()) { if(player->inventory->IsHeldItem()) { @@ -3023,7 +3023,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; default: { - std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = std::dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem)) { @@ -3042,7 +3042,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { int iID=-1; std::shared_ptr heldItem=nullptr; - std::shared_ptr wolf = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr wolf = std::dynamic_pointer_cast(hitResult->entity); if(player->inventory->IsHeldItem()) { @@ -3132,7 +3132,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { int iID=-1; std::shared_ptr heldItem=nullptr; - std::shared_ptr ocelot = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr ocelot = std::dynamic_pointer_cast(hitResult->entity); if(player->inventory->IsHeldItem()) { @@ -3193,7 +3193,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) case eTYPE_PLAYER: { // Fix for #58576 - TU6: Content: Gameplay: Hit button prompt is available when attacking a host who has "Invisible" option turned on - std::shared_ptr TargetPlayer = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr TargetPlayer = std::dynamic_pointer_cast(hitResult->entity); if(!TargetPlayer->hasInvisiblePrivilege()) // This means they are invisible, not just that they have the privilege { @@ -3206,7 +3206,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; case eTYPE_ITEM_FRAME: { - std::shared_ptr itemFrame = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr itemFrame = std::dynamic_pointer_cast(hitResult->entity); // is the frame occupied? if(itemFrame->getItem()!=NULL) @@ -3228,7 +3228,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; case eTYPE_VILLAGER: { - std::shared_ptr villager = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr villager = std::dynamic_pointer_cast(hitResult->entity); if (!villager->isBaby()) { *piUse=IDS_TOOLTIPS_TRADE; @@ -3238,7 +3238,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; case eTYPE_ZOMBIE: { - std::shared_ptr zomb = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr zomb = std::dynamic_pointer_cast(hitResult->entity); std::shared_ptr heldItem=nullptr; if(player->inventory->IsHeldItem()) @@ -3475,9 +3475,9 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) if((player->ullButtonsPressed&(1LL< mob = dynamic_pointer_cast(Creeper::_class->newInstance( level )); - //std::shared_ptr mob = dynamic_pointer_cast(Wolf::_class->newInstance( level )); - std::shared_ptr mob = dynamic_pointer_cast(std::shared_ptr(new Spider( level ))); + //std::shared_ptr mob = std::dynamic_pointer_cast(Creeper::_class->newInstance( level )); + //std::shared_ptr mob = std::dynamic_pointer_cast(Wolf::_class->newInstance( level )); + std::shared_ptr mob = std::dynamic_pointer_cast(std::shared_ptr(new Spider( level ))); mob->moveTo(player->x+1, player->y, player->z+1, level->random->nextFloat() * 360, 0); level->addEntity(mob); } @@ -3507,14 +3507,14 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) if((player->ullButtonsPressed&(1LL<isInputAllowed(MINECRAFT_ACTION_INVENTORY)) { - std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->player ); + std::shared_ptr player = std::dynamic_pointer_cast( Minecraft::GetInstance()->player ); ui.PlayUISFX(eSFX_Press); app.LoadInventoryMenu(iPad,player); } if((player->ullButtonsPressed&(1LL<isInputAllowed(MINECRAFT_ACTION_CRAFTING)) { - std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->player ); + std::shared_ptr player = std::dynamic_pointer_cast( Minecraft::GetInstance()->player ); // 4J-PB - reordered the if statement so creative mode doesn't bring up the crafting table // Fix for #39014 - TU5: Creative Mode: Pressing X to access the creative menu while looking at a crafting table causes the crafting menu to display @@ -4697,7 +4697,7 @@ bool mayUse = true; if(button==1 && (player->isSleeping() && level != NULL && level->isClientSide)) { -std::shared_ptr mplp = dynamic_pointer_cast( player ); +std::shared_ptr mplp = std::dynamic_pointer_cast( player ); if(mplp) mplp->StopSleeping(); -- cgit v1.2.3