]> git.lizzy.rs Git - minetest.git/blobdiff - src/player.h
Dual wielding
[minetest.git] / src / player.h
index 7c8077d38728fd5892bbb4a19d4d9850a286bf90..42d6af3f0377d992e27a0e9f06f7297b8b7dcaf3 100644 (file)
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "constants.h"
 #include "network/networkprotocol.h"
 #include "util/basic_macros.h"
+#include "util/pointedthing.h"
 #include <list>
 #include <mutex>
 
@@ -200,6 +201,13 @@ class Player
 
        // Returns non-empty `selected` ItemStack. `hand` is a fallback, if specified
        ItemStack &getWieldedItem(ItemStack *selected, ItemStack *hand) const;
+
+       // item currently in secondary hand is returned in `offhand`
+       // item to use for place / secondary_use (either main or offhand) is (optionally) returned in `place`
+       // return value: whether to use main or offhand for placing
+       bool getOffhandWieldedItem(ItemStack *offhand, ItemStack *place,
+                       IItemDefManager *idef, const PointedThing &pointed) const;
+
        void setWieldIndex(u16 index);
        u16 getWieldIndex() const { return m_wield_index; }