1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Run callback in IDropAction, refactor function arguments

This commit is contained in:
SmallJoker 2018-03-31 13:47:19 +02:00 committed by Loïc Blot
parent f6eff57f7c
commit 9fa547bb80
8 changed files with 220 additions and 263 deletions

View file

@ -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;