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:
parent
f6eff57f7c
commit
9fa547bb80
8 changed files with 220 additions and 263 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue