mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-09 00:33:00 +00:00
Fix: Lapis Slot for Enchanting takes and consumes any item
This commit is contained in:
parent
48ce29a28e
commit
e0cc846be5
|
|
@ -18,10 +18,6 @@ UIScene_EnchantingMenu::UIScene_EnchantingMenu(int iPad, void *_initData, UILaye
|
|||
m_enchantButton[1].init(1);
|
||||
m_enchantButton[2].init(2);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
EnchantingScreenInput *initData = static_cast<EnchantingScreenInput *>(_initData);
|
||||
|
||||
m_labelEnchant.init( initData->name.empty() ? app.GetString(IDS_ENCHANT) : initData->name );
|
||||
|
|
|
|||
|
|
@ -106,7 +106,6 @@ void EnchantmentMenu::slotsChanged(int a) // 4J used to take a shared_ptr<Contai
|
|||
}
|
||||
m_costsChanged = true;
|
||||
alreadyRan = false;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// 4J Stu Added
|
||||
// In EnchantmentMenu.java they create an anoymous class while creating some slot. I have moved the content
|
||||
// of that anonymous class to here
|
||||
|
||||
#include "Item.h"
|
||||
#include "Slot.h"
|
||||
|
||||
class Container;
|
||||
|
|
@ -10,7 +10,16 @@ class Container;
|
|||
class EnchantmentSlot : public Slot
|
||||
{
|
||||
public:
|
||||
EnchantmentSlot(shared_ptr<Container> container, int id, int x, int y) : Slot(container,id, x, y) {}
|
||||
virtual bool mayPlace(shared_ptr<ItemInstance> item) {return true;}
|
||||
int slotNum;
|
||||
//stack->getItem()->id == 351 && stack->getItem()->getMaterial() == 11
|
||||
EnchantmentSlot(shared_ptr<Container> container, int id, int x, int y) : Slot(container, id, x, y) { slotNum = id; }
|
||||
virtual bool mayPlace(shared_ptr<ItemInstance> item) {
|
||||
if (slotNum == 0 || (item->id == 351 && Item::items[item->id]->getMaterial() == 11)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
virtual bool mayCombine(shared_ptr<ItemInstance> item) {return false;} // 4J Added
|
||||
};
|
||||
Loading…
Reference in a new issue