mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-29 22:55:19 +01: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:
@@ -219,7 +219,7 @@ class PlayerSAO : public UnitSAO
|
||||
public:
|
||||
PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, session_t peer_id_,
|
||||
bool is_singleplayer);
|
||||
~PlayerSAO();
|
||||
|
||||
ActiveObjectType getType() const
|
||||
{ return ACTIVEOBJECT_TYPE_PLAYER; }
|
||||
ActiveObjectType getSendType() const
|
||||
@@ -272,16 +272,13 @@ public:
|
||||
/*
|
||||
Inventory interface
|
||||
*/
|
||||
|
||||
Inventory* getInventory();
|
||||
const Inventory* getInventory() const;
|
||||
Inventory *getInventory() const;
|
||||
InventoryLocation getInventoryLocation() const;
|
||||
std::string getWieldList() const;
|
||||
void setInventoryModified() {}
|
||||
std::string getWieldList() const { return "main"; }
|
||||
u16 getWieldIndex() const;
|
||||
ItemStack getWieldedItem() const;
|
||||
ItemStack getWieldedItemOrHand() const;
|
||||
bool setWieldedItem(const ItemStack &item);
|
||||
int getWieldIndex() const;
|
||||
void setWieldIndex(int i);
|
||||
|
||||
/*
|
||||
PlayerSAO-specific
|
||||
@@ -355,7 +352,6 @@ private:
|
||||
|
||||
RemotePlayer *m_player = nullptr;
|
||||
session_t m_peer_id = 0;
|
||||
Inventory *m_inventory = nullptr;
|
||||
|
||||
// Cheat prevention
|
||||
LagPool m_dig_pool;
|
||||
@@ -371,7 +367,6 @@ private:
|
||||
IntervalLimiter m_drowning_interval;
|
||||
IntervalLimiter m_node_hurt_interval;
|
||||
|
||||
int m_wield_index = 0;
|
||||
bool m_position_not_sent = false;
|
||||
|
||||
// Cached privileges for enforcement
|
||||
|
||||
Reference in New Issue
Block a user