summaryrefslogtreecommitdiffstats
path: root/src/BrewingRecipes.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2024-11-02 22:27:47 +0100
committerAlexander Harkness <me@bearbin.net>2024-11-02 22:27:47 +0100
commitcb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a (patch)
treef647b20e1823f1846af88e832cf82a4a02e96e69 /src/BrewingRecipes.cpp
parentImprove clang-format config file, remove automatically enforced code style from contrib guide. (diff)
downloadcuberite-clang-format-codebase.tar
cuberite-clang-format-codebase.tar.gz
cuberite-clang-format-codebase.tar.bz2
cuberite-clang-format-codebase.tar.lz
cuberite-clang-format-codebase.tar.xz
cuberite-clang-format-codebase.tar.zst
cuberite-clang-format-codebase.zip
Diffstat (limited to 'src/BrewingRecipes.cpp')
-rw-r--r--src/BrewingRecipes.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/BrewingRecipes.cpp b/src/BrewingRecipes.cpp
index 7bce72883..d0676d595 100644
--- a/src/BrewingRecipes.cpp
+++ b/src/BrewingRecipes.cpp
@@ -92,14 +92,22 @@ void cBrewingRecipes::AddRecipeFromLine(AString a_Line, unsigned int a_LineNum)
if (!StringToInteger<short>(InputAndIngredient[0], Recipe->Input.m_ItemDamage))
{
- LOGWARNING("brewing.txt: line %d: Cannot parse the damage value for the input item\"%s\".", a_LineNum, InputAndIngredient[0].c_str());
+ LOGWARNING(
+ "brewing.txt: line %d: Cannot parse the damage value for the input item\"%s\".",
+ a_LineNum,
+ InputAndIngredient[0].c_str()
+ );
LOGINFO("Offending line: \"%s\"", a_Line.c_str());
return;
}
if (!StringToInteger<short>(IngredientAndOutput[1], Recipe->Output.m_ItemDamage))
{
- LOGWARNING("brewing.txt: line %d: Cannot parse the damage value for the output item\"%s\".", a_LineNum, IngredientAndOutput[1].c_str());
+ LOGWARNING(
+ "brewing.txt: line %d: Cannot parse the damage value for the output item\"%s\".",
+ a_LineNum,
+ IngredientAndOutput[1].c_str()
+ );
LOGINFO("Offending line: \"%s\"", a_Line.c_str());
return;
}
@@ -164,13 +172,16 @@ const cBrewingRecipes::cRecipe * cBrewingRecipes::GetRecipeFrom(const cItem & a_
// Search for the drinkable potion, the ingredients are the same
short SplashItemDamage = a_Input.m_ItemDamage - 8192;
- auto FoundRecipe = std::find_if(m_Recipes.cbegin(), m_Recipes.cend(), [&](const std::unique_ptr<cRecipe>& a_Recipe)
- {
- return (
- (a_Recipe->Input.m_ItemDamage == SplashItemDamage) &&
- (a_Recipe->Ingredient.IsEqual(a_Ingredient))
- );
- });
+ auto FoundRecipe = std::find_if(
+ m_Recipes.cbegin(),
+ m_Recipes.cend(),
+ [&](const std::unique_ptr<cRecipe> & a_Recipe)
+ {
+ return (
+ (a_Recipe->Input.m_ItemDamage == SplashItemDamage) && (a_Recipe->Ingredient.IsEqual(a_Ingredient))
+ );
+ }
+ );
if (FoundRecipe == m_Recipes.cend())
{
@@ -230,7 +241,3 @@ bool cBrewingRecipes::IsFuel(const cItem & a_Item) const
{
return (a_Item.m_ItemType == E_ITEM_BLAZE_POWDER);
}
-
-
-
-