summaryrefslogtreecommitdiffstats
path: root/src/Item.cpp
diff options
context:
space:
mode:
authordaniel0916 <theschokolps@gmail.com>2014-04-18 14:34:29 +0200
committerdaniel0916 <theschokolps@gmail.com>2014-04-18 14:34:29 +0200
commit56613d2b22c82f301eb651d1f24a0c2155917d24 (patch)
treec2b6832da76c7252141554ae0012e42aca6c8ba0 /src/Item.cpp
parentRemoved old include (diff)
downloadcuberite-56613d2b22c82f301eb651d1f24a0c2155917d24.tar
cuberite-56613d2b22c82f301eb651d1f24a0c2155917d24.tar.gz
cuberite-56613d2b22c82f301eb651d1f24a0c2155917d24.tar.bz2
cuberite-56613d2b22c82f301eb651d1f24a0c2155917d24.tar.lz
cuberite-56613d2b22c82f301eb651d1f24a0c2155917d24.tar.xz
cuberite-56613d2b22c82f301eb651d1f24a0c2155917d24.tar.zst
cuberite-56613d2b22c82f301eb651d1f24a0c2155917d24.zip
Diffstat (limited to '')
-rw-r--r--src/Item.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Item.cpp b/src/Item.cpp
index 540725492..1941a6693 100644
--- a/src/Item.cpp
+++ b/src/Item.cpp
@@ -286,7 +286,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
cEnchantments Enchantment1 = cEnchantments::GetRandomEnchantmentFromVector(enchantments);
m_Enchantments.AddFromString(Enchantment1.ToString());
- enchantments.erase(std::remove(enchantments.begin(), enchantments.end(), Enchantment1), enchantments.end());
+ cEnchantments::RemoveEnchantmentWeightFromVector(&enchantments, Enchantment1);
// Checking for conflicting enchantments
cEnchantments::CheckEnchantmentConflictsFromVector(enchantments, Enchantment1);
@@ -302,7 +302,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
{
cEnchantments Enchantment2 = cEnchantments::GetRandomEnchantmentFromVector(enchantments);
m_Enchantments.AddFromString(Enchantment2.ToString());
- enchantments.erase(std::remove(enchantments.begin(), enchantments.end(), Enchantment2), enchantments.end());
+ cEnchantments::RemoveEnchantmentWeightFromVector(&enchantments, Enchantment2);
// Checking for conflicting enchantments
cEnchantments::CheckEnchantmentConflictsFromVector(enchantments, Enchantment2);
@@ -318,7 +318,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
{
cEnchantments Enchantment3 = cEnchantments::GetRandomEnchantmentFromVector(enchantments);
m_Enchantments.AddFromString(Enchantment3.ToString());
- enchantments.erase(std::remove(enchantments.begin(), enchantments.end(), Enchantment3), enchantments.end());
+ cEnchantments::RemoveEnchantmentWeightFromVector(&enchantments, Enchantment3);
// Checking for conflicting enchantments
cEnchantments::CheckEnchantmentConflictsFromVector(enchantments, Enchantment3);
@@ -334,7 +334,6 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
{
cEnchantments Enchantment4 = cEnchantments::GetRandomEnchantmentFromVector(enchantments);
m_Enchantments.AddFromString(Enchantment4.ToString());
- enchantments.erase(std::remove(enchantments.begin(), enchantments.end(), Enchantment4), enchantments.end());
}
}