mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +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
|
@ -271,10 +271,6 @@ public:
|
|||
|
||||
void setPlayerControl(PlayerControl &control);
|
||||
|
||||
void selectPlayerItem(u16 item);
|
||||
u16 getPlayerItem() const
|
||||
{ return m_playeritem; }
|
||||
|
||||
// Returns true if the inventory of the local player has been
|
||||
// updated from the server. If it is true, it is set to false.
|
||||
bool getLocalInventoryUpdated();
|
||||
|
@ -285,6 +281,9 @@ public:
|
|||
Inventory* getInventory(const InventoryLocation &loc) override;
|
||||
void inventoryAction(InventoryAction *a) override;
|
||||
|
||||
// Send the item number 'item' as player item to the server
|
||||
void setPlayerItem(u16 item);
|
||||
|
||||
const std::list<std::string> &getConnectedPlayerNames()
|
||||
{
|
||||
return m_env.getPlayerNames();
|
||||
|
@ -454,8 +453,6 @@ private:
|
|||
void Receive();
|
||||
|
||||
void sendPlayerPos();
|
||||
// Send the item number 'item' as player item to the server
|
||||
void sendPlayerItem(u16 item);
|
||||
|
||||
void deleteAuthData();
|
||||
// helper method shared with clientpackethandler
|
||||
|
@ -506,7 +503,6 @@ private:
|
|||
// If 0, server init hasn't been received yet.
|
||||
u16 m_proto_ver = 0;
|
||||
|
||||
u16 m_playeritem = 0;
|
||||
bool m_inventory_updated = false;
|
||||
Inventory *m_inventory_from_server = nullptr;
|
||||
float m_inventory_from_server_age = 0.0f;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue