mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Unify wield item handling (#8677)
This moves the wield item functions to Player and the tool utils for range calculation Also 'local_inventory' was removed due to redundancy in Client
This commit is contained in:
parent
003af74213
commit
e462a9a5ef
14 changed files with 154 additions and 249 deletions
|
@ -173,6 +173,11 @@ public:
|
|||
PlayerSettings &getPlayerSettings() { return m_player_settings; }
|
||||
static void settingsChangedCallback(const std::string &name, void *data);
|
||||
|
||||
// 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; }
|
||||
|
||||
u32 keyPressed = 0;
|
||||
|
||||
HudElement* getHud(u32 id);
|
||||
|
@ -185,6 +190,7 @@ public:
|
|||
protected:
|
||||
char m_name[PLAYERNAME_SIZE];
|
||||
v3f m_speed;
|
||||
u16 m_wield_index = 0;
|
||||
|
||||
std::vector<HudElement *> hud;
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue