1
0
Fork 0
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:
SmallJoker 2019-08-07 19:16:31 +02:00 committed by GitHub
parent 003af74213
commit e462a9a5ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 154 additions and 249 deletions

View file

@ -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: