summaryrefslogtreecommitdiff
path: root/src/inventorymanager.h
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-06-20 12:55:48 +0200
committerest31 <MTest31@outlook.com>2015-06-23 20:18:41 +0200
commit2c1fd29884adec17564d39c0f7792633cbc55f9a (patch)
tree73bdee04a50963ac5990f08b96ee30f069aa8ce7 /src/inventorymanager.h
parentbc55ef337cc83a5c31d4fdafba352a7a26921900 (diff)
downloadminetest-2c1fd29884adec17564d39c0f7792633cbc55f9a.tar.gz
minetest-2c1fd29884adec17564d39c0f7792633cbc55f9a.tar.bz2
minetest-2c1fd29884adec17564d39c0f7792633cbc55f9a.zip
Add MoveSomewhere inventory action
Improve shift+click experience
Diffstat (limited to 'src/inventorymanager.h')
-rw-r--r--src/inventorymanager.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/inventorymanager.h b/src/inventorymanager.h
index a255e979a..bbeb5117c 100644
--- a/src/inventorymanager.h
+++ b/src/inventorymanager.h
@@ -143,15 +143,24 @@ struct IMoveAction : public InventoryAction
InventoryLocation to_inv;
std::string to_list;
s16 to_i;
+ bool move_somewhere;
+
+ // treat these as private
+ // related to movement to somewhere
+ bool caused_by_move_somewhere;
+ u32 move_count;
IMoveAction()
{
count = 0;
from_i = -1;
to_i = -1;
+ move_somewhere = false;
+ caused_by_move_somewhere = false;
+ move_count = 0;
}
- IMoveAction(std::istream &is);
+ IMoveAction(std::istream &is, bool somewhere);
u16 getType() const
{
@@ -160,14 +169,18 @@ struct IMoveAction : public InventoryAction
void serialize(std::ostream &os) const
{
- os<<"Move ";
- os<<count<<" ";
- os<<from_inv.dump()<<" ";
- os<<from_list<<" ";
- os<<from_i<<" ";
- os<<to_inv.dump()<<" ";
- os<<to_list<<" ";
- os<<to_i;
+ if (!move_somewhere)
+ os << "Move ";
+ else
+ os << "MoveSomewhere ";
+ os << count << " ";
+ os << from_inv.dump() << " ";
+ os << from_list << " ";
+ os << from_i << " ";
+ os << to_inv.dump() << " ";
+ os << to_list;
+ if (!move_somewhere)
+ os << " " << to_i;
}
void apply(InventoryManager *mgr, ServerActiveObject *player, IGameDef *gamedef);