aboutsummaryrefslogtreecommitdiff
path: root/engines/wage/world.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wage/world.cpp')
-rw-r--r--engines/wage/world.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp
index 8ae775ad12..a177d32930 100644
--- a/engines/wage/world.cpp
+++ b/engines/wage/world.cpp
@@ -352,8 +352,21 @@ Common::String *World::loadStringFromDITL(Common::MacResManager *resMan, int res
return NULL;
}
+bool ChrComparator(Obj *l, Obj *r) {
+ return l->_index < r->_index;
+}
+
void World::move(Obj *obj, Chr *chr) {
- warning("STUB: World::move(obj, chr)");
+ if (obj == NULL)
+ return;
+
+ Designed *from = obj->removeFromCharOrScene();
+ obj->_currentOwner = chr;
+ chr->_inventory.push_back(obj);
+
+ Common::sort(chr->_inventory.begin(), chr->_inventory.end(), ChrComparator);
+
+ _engine->onMove(obj, from, chr);
}
void World::move(Obj *obj, Scene *scene) {