From 119bff351450ea16ffda550b6e0f67379b29f708 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 17:37:16 +0700 Subject: Revert "shared_ptr -> std::shared_ptr" This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5. --- Minecraft.World/WeighedTreasure.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Minecraft.World/WeighedTreasure.cpp') diff --git a/Minecraft.World/WeighedTreasure.cpp b/Minecraft.World/WeighedTreasure.cpp index 540727e3..d7044644 100644 --- a/Minecraft.World/WeighedTreasure.cpp +++ b/Minecraft.World/WeighedTreasure.cpp @@ -6,19 +6,19 @@ WeighedTreasure::WeighedTreasure(int itemId, int auxValue, int minCount, int maxCount, int weight) : WeighedRandomItem(weight) { - this->item = std::shared_ptr( new ItemInstance(itemId, 1, auxValue) ); + this->item = shared_ptr( new ItemInstance(itemId, 1, auxValue) ); this->minCount = minCount; this->maxCount = maxCount; } -WeighedTreasure::WeighedTreasure(std::shared_ptr item, int minCount, int maxCount, int weight) : WeighedRandomItem(weight) +WeighedTreasure::WeighedTreasure(shared_ptr item, int minCount, int maxCount, int weight) : WeighedRandomItem(weight) { this->item = item; this->minCount = minCount; this->maxCount = maxCount; } -void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, std::shared_ptr dest, int numRolls) +void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, shared_ptr dest, int numRolls) { for (int r = 0; r < numRolls; r++) { @@ -27,7 +27,7 @@ void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, int count = treasure->minCount + random->nextInt(treasure->maxCount - treasure->minCount + 1); if (treasure->item->getMaxStackSize() >= count) { - std::shared_ptr copy = treasure->item->copy(); + shared_ptr copy = treasure->item->copy(); copy->count = count; dest->setItem(random->nextInt(dest->getContainerSize()), copy); } @@ -36,7 +36,7 @@ void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, // use multiple slots for (int c = 0; c < count; c++) { - std::shared_ptr copy = treasure->item->copy(); + shared_ptr copy = treasure->item->copy(); copy->count = 1; dest->setItem(random->nextInt(dest->getContainerSize()), copy); } @@ -44,7 +44,7 @@ void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, } } -void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray items, std::shared_ptr dest, int numRolls) +void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray items, shared_ptr dest, int numRolls) { for (int r = 0; r < numRolls; r++) { @@ -53,7 +53,7 @@ void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray ite int count = treasure->minCount + random->nextInt(treasure->maxCount - treasure->minCount + 1); if (treasure->item->getMaxStackSize() >= count) { - std::shared_ptr copy = treasure->item->copy(); + shared_ptr copy = treasure->item->copy(); copy->count = count; dest->setItem(random->nextInt(dest->getContainerSize()), copy); } @@ -62,7 +62,7 @@ void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray ite // use multiple slots for (int c = 0; c < count; c++) { - std::shared_ptr copy = treasure->item->copy(); + shared_ptr copy = treasure->item->copy(); copy->count = 1; dest->setItem(random->nextInt(dest->getContainerSize()), copy); } -- cgit v1.2.3