diff options
| author | qwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com> | 2026-03-16 21:44:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-16 21:44:26 -0500 |
| commit | ce739f6045ec72127491286ea3f3f21e537c1b55 (patch) | |
| tree | f33bd42a47c1b4a7b2153a7fb77127ee3b407db9 /Minecraft.World/MerchantRecipe.cpp | |
| parent | 255a18fe8e9b57377975f82e2b227afe2a12eda0 (diff) | |
| parent | 5a59f5d146b43811dde6a5a0245ee9875d7b5cd1 (diff) | |
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/MerchantRecipe.cpp')
| -rw-r--r-- | Minecraft.World/MerchantRecipe.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Minecraft.World/MerchantRecipe.cpp b/Minecraft.World/MerchantRecipe.cpp index b772b0c7..b4eb1b54 100644 --- a/Minecraft.World/MerchantRecipe.cpp +++ b/Minecraft.World/MerchantRecipe.cpp @@ -34,12 +34,12 @@ MerchantRecipe::MerchantRecipe(shared_ptr<ItemInstance> buy, shared_ptr<ItemInst MerchantRecipe::MerchantRecipe(shared_ptr<ItemInstance> buy, Item *sell) { - _init(buy, nullptr, shared_ptr<ItemInstance>(new ItemInstance(sell))); + _init(buy, nullptr, std::make_shared<ItemInstance>(sell)); } MerchantRecipe::MerchantRecipe(shared_ptr<ItemInstance> buy, Tile *sell) { - _init(buy, nullptr, shared_ptr<ItemInstance>(new ItemInstance(sell))); + _init(buy, nullptr, std::make_shared<ItemInstance>(sell)); } shared_ptr<ItemInstance> MerchantRecipe::getBuyAItem() @@ -54,7 +54,7 @@ shared_ptr<ItemInstance> MerchantRecipe::getBuyBItem() bool MerchantRecipe::hasSecondaryBuyItem() { - return buyB != NULL; + return buyB != nullptr; } shared_ptr<ItemInstance> MerchantRecipe::getSellItem() @@ -68,13 +68,13 @@ bool MerchantRecipe::isSame(MerchantRecipe *other) { return false; } - return (buyB == NULL && other->buyB == NULL) || (buyB != NULL && other->buyB != NULL && buyB->id == other->buyB->id); + return (buyB == nullptr && other->buyB == nullptr) || (buyB != nullptr && other->buyB != nullptr && buyB->id == other->buyB->id); } bool MerchantRecipe::isSameSameButBetter(MerchantRecipe *other) { // same deal, but cheaper - return isSame(other) && (buyA->count < other->buyA->count || (buyB != NULL && buyB->count < other->buyB->count)); + return isSame(other) && (buyA->count < other->buyA->count || (buyB != nullptr && buyB->count < other->buyB->count)); } int MerchantRecipe::getUses() @@ -136,7 +136,7 @@ CompoundTag *MerchantRecipe::createTag() CompoundTag *tag = new CompoundTag(); tag->putCompound(L"buy", buyA->save(new CompoundTag(L"buy"))); tag->putCompound(L"sell", sell->save(new CompoundTag(L"sell"))); - if (buyB != NULL) + if (buyB != nullptr) { tag->putCompound(L"buyB", buyB->save(new CompoundTag(L"buyB"))); } |
