aboutsummaryrefslogtreecommitdiff
path: root/src/content_sao.h
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-08-07 19:16:31 +0200
committerGitHub <noreply@github.com>2019-08-07 19:16:31 +0200
commite462a9a5ef46776d974203bb44e0b89e8c980b29 (patch)
tree4562ef5587bd896890d843877031d5818de19bbc /src/content_sao.h
parent003af7421352ec1b8ba0d230b807862e1e4cc7e9 (diff)
downloadhax-minetest-server-e462a9a5ef46776d974203bb44e0b89e8c980b29.tar.gz
hax-minetest-server-e462a9a5ef46776d974203bb44e0b89e8c980b29.zip
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
Diffstat (limited to 'src/content_sao.h')
-rw-r--r--src/content_sao.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/content_sao.h b/src/content_sao.h
index c579474ee..beaf697e6 100644
--- a/src/content_sao.h
+++ b/src/content_sao.h
@@ -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