1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-18 18:55:29 +02:00

Clamp hotbar selection to slots that exist (#14869)

This commit is contained in:
1F616EMO~nya
2024-08-12 21:35:13 +08:00
committed by GitHub
parent 39c2af9710
commit 98e51a0159
8 changed files with 51 additions and 11 deletions

View File

@@ -223,7 +223,7 @@ public:
// Returns non-empty `selected` ItemStack. `hand` is a fallback, if specified
ItemStack &getWieldedItem(ItemStack *selected, ItemStack *hand) const;
void setWieldIndex(u16 index);
u16 getWieldIndex() const { return m_wield_index; }
u16 getWieldIndex();
bool setFov(const PlayerFovSpec &spec)
{
@@ -247,6 +247,9 @@ public:
u32 hud_flags;
s32 hud_hotbar_itemcount;
// Get actual usable number of hotbar items (clamped to size of "main" list)
u16 getMaxHotbarItemcount();
protected:
char m_name[PLAYERNAME_SIZE];
v3f m_speed; // velocity; in BS-space