summaryrefslogtreecommitdiffstats
path: root/src/Item.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-04-20 13:54:17 +0200
committermadmaxoft <github@xoft.cz>2014-04-21 10:31:29 +0200
commitbdd8b43b3eb0f71fff383d9a844e910fe9db7925 (patch)
tree2e90a9d931ec3cb90978ebeb44b213d9e06b91ea /src/Item.cpp
parentFixed a warning in CraftingRecipes. (diff)
downloadcuberite-bdd8b43b3eb0f71fff383d9a844e910fe9db7925.tar
cuberite-bdd8b43b3eb0f71fff383d9a844e910fe9db7925.tar.gz
cuberite-bdd8b43b3eb0f71fff383d9a844e910fe9db7925.tar.bz2
cuberite-bdd8b43b3eb0f71fff383d9a844e910fe9db7925.tar.lz
cuberite-bdd8b43b3eb0f71fff383d9a844e910fe9db7925.tar.xz
cuberite-bdd8b43b3eb0f71fff383d9a844e910fe9db7925.tar.zst
cuberite-bdd8b43b3eb0f71fff383d9a844e910fe9db7925.zip
Diffstat (limited to 'src/Item.cpp')
-rw-r--r--src/Item.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Item.cpp b/src/Item.cpp
index 6a5fefbe1..d7424267a 100644
--- a/src/Item.cpp
+++ b/src/Item.cpp
@@ -318,7 +318,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
// Next Enchantment (Second)
NewEnchantmentLevel = NewEnchantmentLevel / 2;
float SecondEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
- if ((Random.NextFloat(100) > SecondEnchantmentChance) || (enchantments.size() == 0))
+ if (enchantments.empty() || (Random.NextFloat(100) > SecondEnchantmentChance))
{
return true;
}
@@ -333,7 +333,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
// Next Enchantment (Third)
NewEnchantmentLevel = NewEnchantmentLevel / 2;
float ThirdEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
- if ((Random.NextFloat(100) > ThirdEnchantmentChance) || (enchantments.size() == 0))
+ if (enchantments.empty() || (Random.NextFloat(100) > ThirdEnchantmentChance))
{
return true;
}
@@ -348,7 +348,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
// Next Enchantment (Fourth)
NewEnchantmentLevel = NewEnchantmentLevel / 2;
float FourthEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
- if ((Random.NextFloat(100) > FourthEnchantmentChance) || (enchantments.size() == 0))
+ if (enchantments.empty() || (Random.NextFloat(100) > FourthEnchantmentChance))
{
return true;
}