mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Clamp hotbar selection to slots that exist (#14869)
This commit is contained in:
parent
39c2af9710
commit
98e51a0159
8 changed files with 51 additions and 11 deletions
|
@ -783,7 +783,7 @@ void Hud::drawHotbar(u16 playeritem)
|
|||
|
||||
v2s32 centerlowerpos(m_displaycenter.X, m_screensize.Y);
|
||||
|
||||
s32 hotbar_itemcount = player->hud_hotbar_itemcount;
|
||||
s32 hotbar_itemcount = player->getMaxHotbarItemcount();
|
||||
s32 width = hotbar_itemcount * (m_hotbar_imagesize + m_padding * 2);
|
||||
v2s32 pos = centerlowerpos - v2s32(width / 2, m_hotbar_imagesize + m_padding * 3);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue