Added anvil enchantment handling. (#3857)
+ Added anvil enchantment handling.
This commit is contained in:
@@ -730,7 +730,6 @@ void cSlotAreaCrafting::UpdateRecipe(cPlayer & a_Player)
|
||||
cCraftingRecipe & Recipe = GetRecipeForPlayer(a_Player);
|
||||
cRoot::Get()->GetCraftingRecipes()->GetRecipe(a_Player, Grid, Recipe);
|
||||
SetSlot(0, a_Player, Recipe.GetResult());
|
||||
m_ParentWindow.SendSlot(a_Player, this, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1136,7 +1135,9 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Add enchantments.
|
||||
// Add the enchantments from the sacrifice to the target
|
||||
int EnchantmentCost = Input.AddEnchantmentsFromItem(SecondInput);
|
||||
NeedExp += EnchantmentCost;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1166,8 +1167,6 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player)
|
||||
Input.m_CustomName = RepairedItemName;
|
||||
}
|
||||
|
||||
// TODO: Add enchantment exp cost.
|
||||
|
||||
m_MaximumCost = RepairCost + NeedExp;
|
||||
|
||||
if (NeedExp < 0)
|
||||
@@ -2522,6 +2521,8 @@ void cSlotAreaTemporary::SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem
|
||||
}
|
||||
|
||||
itr->second[static_cast<size_t>(a_SlotNum)] = a_Item;
|
||||
|
||||
m_ParentWindow.SendSlot(a_Player, this, a_SlotNum);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user