Fix Selecting "..." Slot With Keyboard

This commit is contained in:
TheBrokenRail
2023-11-05 00:19:04 -04:00
committed by iProgramInCpp
parent 93dc4e934e
commit 4cabfd30ac

View File

@@ -433,9 +433,7 @@ void Minecraft::tickInput()
{
int slot = m_pLocalPlayer->m_pInventory->m_SelectedHotbarSlot;
int maxItems = m_gui.getNumSlots() - 1;
if (isTouchscreen())
maxItems--;
int maxItems = m_gui.getNumUsableSlots() - 1;
if (Mouse::getEventButtonState() == 0) // @NOTE: Scroll up
{
@@ -469,7 +467,7 @@ void Minecraft::tickInput()
{
m_gui.handleKeyPressed(keyCode);
for (int i = 0; i < m_gui.getNumSlots(); i++)
for (int i = 0; i < m_gui.getNumUsableSlots(); i++)
{
if (getOptions()->isKey(eKeyMappingIndex(KM_SLOT_1 + i), keyCode))
m_pLocalPlayer->m_pInventory->selectSlot(i);