diff options
author | Eugene Sandulenko | 2015-12-25 12:49:47 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-27 15:41:02 +0100 |
commit | 5f2ef620c18b36fe0d480474135aa78eb9eb0c01 (patch) | |
tree | 79944e688a45bc14b2f59e86404ceea35c076070 /engines/wage/world.cpp | |
parent | 59b2809f3740923cc63477a25eaabde2535f6f2e (diff) | |
download | scummvm-rg350-5f2ef620c18b36fe0d480474135aa78eb9eb0c01.tar.gz scummvm-rg350-5f2ef620c18b36fe0d480474135aa78eb9eb0c01.tar.bz2 scummvm-rg350-5f2ef620c18b36fe0d480474135aa78eb9eb0c01.zip |
WAGE: Implemented World::move(Obj *obj, Chr *chr)
Diffstat (limited to 'engines/wage/world.cpp')
-rw-r--r-- | engines/wage/world.cpp | 15 |
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) { |