1
0

Fixed some Errors (not all)

This commit is contained in:
daniel0916
2014-04-17 19:31:43 +02:00
parent f9343a8490
commit 0086fcfef1
4 changed files with 21 additions and 20 deletions

View File

@@ -2735,15 +2735,18 @@ void cClientHandle::HandleEnchantItem(Byte & WindowID, Byte & Enchantment)
cItem Item = *Window->m_SlotArea->GetSlot(0, *m_Player);
int BaseEnchantmentLevel = Window->GetPropertyValue(Enchantment);
if (Item.EnchantByXPLevels(BaseEnchantmentLevel, *m_Player, true, true))
if (Item.EnchantByXPLevels(BaseEnchantmentLevel))
{
Window->m_SlotArea->SetSlot(0, *m_Player, Item);
Window->SendSlot(*m_Player, Window->m_SlotArea, 0);
Window->BroadcastWholeWindow();
if (m_Player->IsGameModeCreative() | m_Player->DeltaExperience(-m_Player->XpForLevel(BaseEnchantmentLevel)) >= 0)
{
Window->m_SlotArea->SetSlot(0, *m_Player, Item);
Window->SendSlot(*m_Player, Window->m_SlotArea, 0);
Window->BroadcastWholeWindow();
Window->SetProperty(0, 0, *m_Player);
Window->SetProperty(1, 0, *m_Player);
Window->SetProperty(2, 0, *m_Player);
Window->SetProperty(0, 0, *m_Player);
Window->SetProperty(1, 0, *m_Player);
Window->SetProperty(2, 0, *m_Player);
}
}
}