From 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a Mon Sep 17 00:00:00 2001 From: Loki Rautio Date: Sat, 7 Mar 2026 21:12:22 -0600 Subject: Revert "Project modernization (#630)" This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817. --- Minecraft.World/MerchantContainer.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Minecraft.World/MerchantContainer.cpp') diff --git a/Minecraft.World/MerchantContainer.cpp b/Minecraft.World/MerchantContainer.cpp index b9c9bb52..7ceb4745 100644 --- a/Minecraft.World/MerchantContainer.cpp +++ b/Minecraft.World/MerchantContainer.cpp @@ -11,7 +11,7 @@ MerchantContainer::MerchantContainer(shared_ptr player, shared_ptr MerchantContainer::getItem(unsigned int slot) shared_ptr MerchantContainer::removeItem(unsigned int slot, int count) { - if (items[slot] != nullptr) + if (items[slot] != NULL) { if (slot == MerchantMenu::RESULT_SLOT) { @@ -71,7 +71,7 @@ bool MerchantContainer::isPaymentSlot(int slot) shared_ptr MerchantContainer::removeItemNoUpdate(int slot) { - if (items[slot] != nullptr) + if (items[slot] != NULL) { shared_ptr item = items[slot]; items[slot] = nullptr; @@ -83,7 +83,7 @@ shared_ptr MerchantContainer::removeItemNoUpdate(int slot) void MerchantContainer::setItem(unsigned int slot, shared_ptr item) { items[slot] = item; - if (item != nullptr && item->count > getMaxStackSize()) item->count = getMaxStackSize(); + if (item != NULL && item->count > getMaxStackSize()) item->count = getMaxStackSize(); if (isPaymentSlot(slot)) { updateSellItem(); @@ -135,37 +135,37 @@ void MerchantContainer::setChanged() void MerchantContainer::updateSellItem() { - activeRecipe = nullptr; + activeRecipe = NULL; shared_ptr buyItem1 = items[MerchantMenu::PAYMENT1_SLOT]; shared_ptr buyItem2 = items[MerchantMenu::PAYMENT2_SLOT]; - if (buyItem1 == nullptr) + if (buyItem1 == NULL) { buyItem1 = buyItem2; buyItem2 = nullptr; } - if (buyItem1 == nullptr) + if (buyItem1 == NULL) { setItem(MerchantMenu::RESULT_SLOT, nullptr); } else { MerchantRecipeList *offers = merchant->getOffers(player); - if (offers != nullptr) + if (offers != NULL) { MerchantRecipe *recipeFor = offers->getRecipeFor(buyItem1, buyItem2, selectionHint); - if (recipeFor != nullptr && !recipeFor->isDeprecated()) + if (recipeFor != NULL && !recipeFor->isDeprecated()) { activeRecipe = recipeFor; setItem(MerchantMenu::RESULT_SLOT, recipeFor->getSellItem()->copy()); } - else if (buyItem2 != nullptr) + else if (buyItem2 != NULL) { // try to switch recipeFor = offers->getRecipeFor(buyItem2, buyItem1, selectionHint); - if (recipeFor != nullptr && !recipeFor->isDeprecated()) + if (recipeFor != NULL && !recipeFor->isDeprecated()) { activeRecipe = recipeFor; setItem(MerchantMenu::RESULT_SLOT, recipeFor->getSellItem()->copy()); -- cgit v1.2.3