fix: unglob std::{min, max}, manual stuff

This commit is contained in:
Tropical
2026-03-06 20:47:11 -06:00
parent 967ffbb2a6
commit 04ff82ba70
54 changed files with 126 additions and 126 deletions

View File

@@ -82,7 +82,7 @@ void RepairMenu::createResult()
if (result->isDamageableItem() && Item::items[result->id]->isValidRepairItem(input, addition))
{
int repairAmount = min(result->getDamageValue(), result->getMaxDamage() / 4);
int repairAmount = std::min(result->getDamageValue(), result->getMaxDamage() / 4);
if (repairAmount <= 0)
{
resultSlots->setItem(0, nullptr);
@@ -96,9 +96,9 @@ void RepairMenu::createResult()
{
int resultDamage = result->getDamageValue() - repairAmount;
result->setAuxValue(resultDamage);
price += max(1, repairAmount / 100) + enchantments->size();
price += std::max(1, repairAmount / 100) + enchantments->size();
repairAmount = min(result->getDamageValue(), result->getMaxDamage() / 4);
repairAmount = std::min(result->getDamageValue(), result->getMaxDamage() / 4);
count++;
}
repairItemCountCost = count;
@@ -124,10 +124,10 @@ void RepairMenu::createResult()
if (resultDamage < result->getAuxValue())
{
result->setAuxValue(resultDamage);
price += max(1, additional / 100);
price += std::max(1, additional / 100);
if (DEBUG_COST)
{
app.DebugPrintf("Repairing; price is now %d (went up by %d)\n", price, max(1, additional / 100) );
app.DebugPrintf("Repairing; price is now %d (went up by %d)\n", price, std::max(1, additional / 100) );
}
}
}
@@ -141,7 +141,7 @@ void RepairMenu::createResult()
AUTO_VAR(localIt, enchantments->find(id));
int current = localIt != enchantments->end() ? localIt->second : 0;
int level = it->second;
level = (current == level) ? level += 1 : max(level, current);
level = (current == level) ? level += 1 : std::max(level, current);
int extra = level - current;
bool compatible = enchantment->canEnchant(input);
@@ -183,7 +183,7 @@ void RepairMenu::createResult()
break;
}
if (usingBook) fee = max(1, fee / 2);
if (usingBook) fee = std::max(1, fee / 2);
price += fee * extra;
if (DEBUG_COST)
@@ -244,7 +244,7 @@ void RepairMenu::createResult()
break;
}
if (usingBook) fee = max(1, fee / 2);
if (usingBook) fee = std::max(1, fee / 2);
tax += count + level * fee;
if (DEBUG_COST)
@@ -253,7 +253,7 @@ void RepairMenu::createResult()
}
}
if (usingBook) tax = max(1, tax / 2);
if (usingBook) tax = std::max(1, tax / 2);
cost = tax + price;
if (price <= 0)