Fixed the armor slot in creative mode. Also removed that armor get directly to the armor slot. It is extremely buggy and unnecessary.
This commit is contained in:
parent
9c32e31edf
commit
2e9aed793a
@ -102,15 +102,6 @@ int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks, bool a_tryT
|
||||
{
|
||||
cItem ToAdd(a_Item);
|
||||
int res = 0;
|
||||
if (ItemCategory::IsArmor(a_Item.m_ItemType))
|
||||
{
|
||||
res = m_ArmorSlots.AddItem(ToAdd, a_AllowNewStacks);
|
||||
ToAdd.m_ItemCount -= res;
|
||||
if (ToAdd.m_ItemCount == 0)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
res += m_HotbarSlots.AddItem(ToAdd, a_AllowNewStacks, a_tryToFillEquippedFirst ? m_EquippedSlotNum : -1);
|
||||
ToAdd.m_ItemCount = a_Item.m_ItemCount - res;
|
||||
|
@ -1866,6 +1866,19 @@ void cSlotAreaArmor::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_C
|
||||
{
|
||||
ASSERT((a_SlotNum >= 0) && (a_SlotNum < GetNumSlots()));
|
||||
|
||||
if (a_Player.IsGameModeCreative() && (m_ParentWindow.GetWindowType() == cWindow::wtInventory))
|
||||
{
|
||||
if ((a_ClickAction == caDropKey) || (a_ClickAction == caCtrlDropKey))
|
||||
{
|
||||
DropClicked(a_Player, a_SlotNum, (a_ClickAction == caCtrlDropKey));
|
||||
return;
|
||||
}
|
||||
|
||||
// Creative inventory must treat a_ClickedItem as a DraggedItem instead, replacing the inventory slot with it
|
||||
SetSlot(a_SlotNum, a_Player, a_ClickedItem);
|
||||
return;
|
||||
}
|
||||
|
||||
bool bAsync = false;
|
||||
if (GetSlot(a_SlotNum, a_Player) == NULL)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user