summaryrefslogtreecommitdiff
path: root/src/inventorymanager.h
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2018-03-31 13:47:19 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-04-02 17:18:48 +0200
commit9fa547bb8013e78991c362b73111a134216307a0 (patch)
tree5bb17a9b59af346d53982eb1c06d9313a9ec18b0 /src/inventorymanager.h
parentf6eff57f7cf504c715f9b58147667f2ae77732c0 (diff)
downloadminetest-9fa547bb8013e78991c362b73111a134216307a0.tar.gz
minetest-9fa547bb8013e78991c362b73111a134216307a0.tar.bz2
minetest-9fa547bb8013e78991c362b73111a134216307a0.zip
Run callback in IDropAction, refactor function arguments
Diffstat (limited to 'src/inventorymanager.h')
-rw-r--r--src/inventorymanager.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/inventorymanager.h b/src/inventorymanager.h
index 9ae92e5f4..30a82d4bf 100644
--- a/src/inventorymanager.h
+++ b/src/inventorymanager.h
@@ -134,16 +134,20 @@ struct InventoryAction
virtual ~InventoryAction() = default;;
};
-struct IMoveAction : public InventoryAction
+struct MoveAction
{
- // count=0 means "everything"
- u16 count = 0;
InventoryLocation from_inv;
std::string from_list;
s16 from_i = -1;
InventoryLocation to_inv;
std::string to_list;
s16 to_i = -1;
+};
+
+struct IMoveAction : public InventoryAction, public MoveAction
+{
+ // count=0 means "everything"
+ u16 count = 0;
bool move_somewhere = false;
// treat these as private
@@ -181,13 +185,10 @@ struct IMoveAction : public InventoryAction
void clientApply(InventoryManager *mgr, IGameDef *gamedef);
};
-struct IDropAction : public InventoryAction
+struct IDropAction : public InventoryAction, public MoveAction
{
// count=0 means "everything"
u16 count = 0;
- InventoryLocation from_inv;
- std::string from_list;
- s16 from_i = -1;
IDropAction() = default;