From 54647362a079f9da8e49dda35fdc61920cbe02e4 Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:47:22 -0600 Subject: [PATCH] Update StarCraftingInterface.cpp --- source/frontend/StarCraftingInterface.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/frontend/StarCraftingInterface.cpp b/source/frontend/StarCraftingInterface.cpp index 34e0265..d3f2259 100644 --- a/source/frontend/StarCraftingInterface.cpp +++ b/source/frontend/StarCraftingInterface.cpp @@ -41,6 +41,7 @@ CraftingPane::CraftingPane(WorldClientPtr worldClient, PlayerPtr player, Json co m_settings = jsonMerge(assets->json("/interface/windowconfig/crafting.config:default"), jsonMerge(assets->fetchJson(baseConfig), settings)); + m_maxSpinCount = m_settings.get("maxSpinCount", 1000); m_filter = StringSet::from(jsonToStringList(m_settings.get("filter", JsonArray()))); GuiReader reader; @@ -752,14 +753,14 @@ List CraftingPane::determineRecipes() { int CraftingPane::maxCraft() { if (m_player->isAdmin()) - return 1000; + return m_maxSpinCount; auto itemDb = Root::singleton().itemDatabase(); int res = 0; if (m_guiList->selectedItem() != NPos && m_guiList->selectedItem() < m_recipes.size()) { HashMap normalizedBag = m_player->inventory()->availableItems(); auto selectedRecipe = recipeFromSelectedWidget(); res = itemDb->maxCraftableInBag(normalizedBag, m_player->inventory()->availableCurrencies(), selectedRecipe); - res = std::min(res, 1000); + res = std::min(res, m_maxSpinCount); } return res; }