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 a9be52c41a.
This commit is contained in:
Loki Rautio
2026-03-07 21:12:22 -06:00
parent a9be52c41a
commit 087b7e7abf
1373 changed files with 19449 additions and 19903 deletions

View File

@@ -8,8 +8,8 @@
AnvilMenu::AnvilMenu(shared_ptr<Inventory> inventory, Level *level, int xt, int yt, int zt, shared_ptr<Player> player)
{
resultSlots = std::make_shared<ResultContainer>();
repairSlots = std::make_shared<RepairContainer>(this,IDS_REPAIR_AND_NAME, true, 2);
resultSlots = shared_ptr<ResultContainer>( new ResultContainer() );
repairSlots = shared_ptr<RepairContainer>( new RepairContainer(this,IDS_REPAIR_AND_NAME, true, 2) );
cost = 0;
repairItemCountCost = 0;
@@ -55,7 +55,7 @@ void AnvilMenu::createResult()
if (DEBUG_COST) app.DebugPrintf("----");
if (input == nullptr)
if (input == NULL)
{
resultSlots->setItem(0, nullptr);
cost = 0;
@@ -68,15 +68,15 @@ void AnvilMenu::createResult()
unordered_map<int,int> *enchantments = EnchantmentHelper::getEnchantments(result);
bool usingBook = false;
tax += input->getBaseRepairCost() + (addition == nullptr ? 0 : addition->getBaseRepairCost());
tax += input->getBaseRepairCost() + (addition == NULL ? 0 : addition->getBaseRepairCost());
if (DEBUG_COST)
{
app.DebugPrintf("Starting with base repair tax of %d (%d + %d)\n", tax, input->getBaseRepairCost(), (addition == nullptr ? 0 : addition->getBaseRepairCost()));
app.DebugPrintf("Starting with base repair tax of %d (%d + %d)\n", tax, input->getBaseRepairCost(), (addition == NULL ? 0 : addition->getBaseRepairCost()));
}
repairItemCountCost = 0;
if (addition != nullptr)
if (addition != NULL)
{
usingBook = addition->id == Item::enchantedBook_Id && Item::enchantedBook->getEnchantments(addition)->size() > 0;
@@ -290,10 +290,10 @@ void AnvilMenu::createResult()
result = nullptr;
}
if (result != nullptr)
if (result != NULL)
{
int baseCost = result->getBaseRepairCost();
if (addition != nullptr && baseCost < addition->getBaseRepairCost()) baseCost = addition->getBaseRepairCost();
if (addition != NULL && baseCost < addition->getBaseRepairCost()) baseCost = addition->getBaseRepairCost();
if (result->hasCustomHoverName()) baseCost -= 9;
if (baseCost < 0) baseCost = 0;
baseCost += 2;
@@ -344,7 +344,7 @@ void AnvilMenu::removed(shared_ptr<Player> player)
for (int i = 0; i < repairSlots->getContainerSize(); i++)
{
shared_ptr<ItemInstance> item = repairSlots->removeItemNoUpdate(i);
if (item != nullptr)
if (item != NULL)
{
player->drop(item);
}
@@ -362,7 +362,7 @@ shared_ptr<ItemInstance> AnvilMenu::quickMoveStack(shared_ptr<Player> player, in
{
shared_ptr<ItemInstance> clicked = nullptr;
Slot *slot = slots.at(slotIndex);
if (slot != nullptr && slot->hasItem())
if (slot != NULL && slot->hasItem())
{
shared_ptr<ItemInstance> stack = slot->getItem();
clicked = stack->copy();