mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-18 10:45:27 +02: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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user