mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-09 02:22:54 +00:00
Fix: Enchanting Table taking wrong levels
Was using cost instead of the index of the slot
This commit is contained in:
parent
4fe92f9a5a
commit
f307d7b0eb
|
|
@ -292,7 +292,7 @@ void IUIScene_AbstractContainerMenu::handleEnchantButton(int slot, int iPad) {
|
|||
eMinecraftColour colCost = costEnough ? eHTMLColor_7 : eHTMLColor_c;
|
||||
|
||||
std::wstring message = costEnough
|
||||
? std::to_wstring(menu->costs[slot]) + L" Enchantment Levels"
|
||||
? std::to_wstring(slot + 1) + (slot == 0 ? L" Enchantment Level" : L" Enchantment Levels")
|
||||
: L"Level Requirement: " + std::to_wstring(menu->costs[slot]);
|
||||
|
||||
vector<HtmlString>* lines = new vector<HtmlString>();
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ bool EnchantmentMenu::clickMenuButton(shared_ptr<Player> player, int i)
|
|||
if (newEnchantment != nullptr)
|
||||
{
|
||||
|
||||
player->giveExperienceLevels(-costs[i]);
|
||||
player->giveExperienceLevels(-(i + 1));
|
||||
if (isBook) item->id = Item::enchantedBook_Id;
|
||||
int randomIndex = isBook ? random.nextInt(newEnchantment->size()) : -1;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue