04-19-2014, 10:51 PM
Yes, but your code only uses the ID to check if the enchantment is there. Which is exactly what you get with this function:
if (it->GetLevel(a_EnchantmentID) > 0) { // This weighted enchantment contains the enchantment we don't want, erase it: a_Enchantments->erase(it); // Do not break, there may be more incompatible enchantments }The code also shouldn't break from the for-loop, since there may be multiple weighted enchantments that need removing. But then you need to care about iterator validity after calling the erase() function.