diff options
author | daniel0916 <theschokolps@gmail.com> | 2014-04-16 14:52:09 +0200 |
---|---|---|
committer | daniel0916 <theschokolps@gmail.com> | 2014-04-16 14:52:09 +0200 |
commit | a0725747af9581744577be7ed06c07ec9c9fe3f2 (patch) | |
tree | 739ac52b3e850e501440c61e6a1bdc5e6ed5c9a0 | |
parent | Added deletions from merge conflict (diff) | |
download | cuberite-a0725747af9581744577be7ed06c07ec9c9fe3f2.tar cuberite-a0725747af9581744577be7ed06c07ec9c9fe3f2.tar.gz cuberite-a0725747af9581744577be7ed06c07ec9c9fe3f2.tar.bz2 cuberite-a0725747af9581744577be7ed06c07ec9c9fe3f2.tar.lz cuberite-a0725747af9581744577be7ed06c07ec9c9fe3f2.tar.xz cuberite-a0725747af9581744577be7ed06c07ec9c9fe3f2.tar.zst cuberite-a0725747af9581744577be7ed06c07ec9c9fe3f2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ClientHandle.cpp | 46 | ||||
-rw-r--r-- | src/ClientHandle.h | 2 |
2 files changed, 24 insertions, 24 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 319af9ed3..688441d39 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -3530,15 +3530,15 @@ void cClientHandle::AddEnchantmentWeight(cEnchantmentsVector & a_Enchantments, i -void cClientHandle::RemoveEnchantmentFromVector(cEnchantmentsVector & a_Enchantments, int a_EnchantmentID) +void cClientHandle::RemoveEnchantmentFromVector(cEnchantmentsVector * a_Enchantments, int a_EnchantmentID) { - for (cEnchantmentsVector::iterator it = a_Enchantments.begin(); it != a_Enchantments.end(); ++it) + for (cEnchantmentsVector::iterator it = a_Enchantments->begin(); it != a_Enchantments->end(); ++it) { int EnchantmentID = atoi(StringSplit((*it).ToString(), "=")[0].c_str()); if (EnchantmentID == a_EnchantmentID) { - a_Enchantments.erase(std::remove(a_Enchantments.begin(), a_Enchantments.end(), *it), a_Enchantments.end()); + a_Enchantments->erase(std::remove(a_Enchantments->begin(), a_Enchantments->end(), *it), a_Enchantments->end()); break; } } @@ -3554,51 +3554,51 @@ void cClientHandle::CheckEnchantmentConflicts(cEnchantmentsVector & a_Enchantmen if (FirstEnchantmentID == cEnchantments::enchProtection) { - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchFireProtection); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchBlastProtection); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchProjectileProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchFireProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchBlastProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchProjectileProtection); } else if (FirstEnchantmentID == cEnchantments::enchFireProtection) { - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchProtection); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchBlastProtection); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchProjectileProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchBlastProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchProjectileProtection); } else if (FirstEnchantmentID == cEnchantments::enchBlastProtection) { - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchProtection); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchFireProtection); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchProjectileProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchFireProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchProjectileProtection); } else if (FirstEnchantmentID == cEnchantments::enchProjectileProtection) { - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchProtection); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchFireProtection); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchBlastProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchFireProtection); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchBlastProtection); } else if (FirstEnchantmentID == cEnchantments::enchSharpness) { - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchSmite); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchBaneOfArthropods); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchSmite); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchBaneOfArthropods); } else if (FirstEnchantmentID == cEnchantments::enchSmite) { - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchSharpness); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchBaneOfArthropods); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchSharpness); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchBaneOfArthropods); } else if (FirstEnchantmentID == cEnchantments::enchBaneOfArthropods) { - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchSharpness); - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchSmite); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchSharpness); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchSmite); } else if (FirstEnchantmentID == cEnchantments::enchSilkTouch) { - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchFortune); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchFortune); } else if (FirstEnchantmentID == cEnchantments::enchFortune) { - RemoveEnchantmentFromVector(a_Enchantments, cEnchantments::enchSilkTouch); + RemoveEnchantmentFromVector(&a_Enchantments, cEnchantments::enchSilkTouch); } } diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 8bba0d27c..1829e3b4d 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -249,7 +249,7 @@ public: /** Called when the player will enchant a Item */ void HandleEnchantItem(Byte & WindowID, Byte & Enchantment); void AddEnchantmentWeight(cEnchantmentsVector & a_Enchantments, int a_Weight, cEnchantments a_Enchantment); - void RemoveEnchantmentFromVector(cEnchantmentsVector & a_Enchantments, int a_EnchantmentID); + void RemoveEnchantmentFromVector(cEnchantmentsVector * a_Enchantments, int a_EnchantmentID); void CheckEnchantmentConflicts(cEnchantmentsVector & a_Enchantments, cEnchantments a_FirstEnchantment); private: |