From ba762bcd49c9f3ffa3cc4ecac73b13365c2047ec Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 15 Nov 2011 21:00:39 +0200 Subject: Clean mapnode.h and fix other files accordingly --- src/inventory.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/inventory.cpp') diff --git a/src/inventory.cpp b/src/inventory.cpp index 8ddbd3ac8..1929761a5 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -800,6 +800,28 @@ static std::string describeC(const struct InventoryContext *c) return std::string("current_player=") + c->current_player->getName(); } +IMoveAction::IMoveAction(std::istream &is) +{ + std::string ts; + + std::getline(is, ts, ' '); + count = stoi(ts); + + std::getline(is, from_inv, ' '); + + std::getline(is, from_list, ' '); + + std::getline(is, ts, ' '); + from_i = stoi(ts); + + std::getline(is, to_inv, ' '); + + std::getline(is, to_list, ' '); + + std::getline(is, ts, ' '); + to_i = stoi(ts); +} + void IMoveAction::apply(InventoryContext *c, InventoryManager *mgr) { Inventory *inv_from = mgr->getInventory(c, from_inv); -- cgit v1.2.3