diff options
author | Eugene Sandulenko | 2016-01-21 14:38:15 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-02-14 17:12:51 +0100 |
commit | 3cdc17be949ba72ee185f2c33e1f1949a08a0054 (patch) | |
tree | 2441c70a2001e6d358fce7fe70629ff4de58dd13 /engines | |
parent | b90e9361feaa844b8ca097bcef2a4fc5558e15b1 (diff) | |
download | scummvm-rg350-3cdc17be949ba72ee185f2c33e1f1949a08a0054.tar.gz scummvm-rg350-3cdc17be949ba72ee185f2c33e1f1949a08a0054.tar.bz2 scummvm-rg350-3cdc17be949ba72ee185f2c33e1f1949a08a0054.zip |
WAGE: Implement handleTakeCommand()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/script.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp index ee70709f43..578267f75f 100644 --- a/engines/wage/script.cpp +++ b/engines/wage/script.cpp @@ -1057,7 +1057,21 @@ void Script::handleAcceptCommand() { } void Script::handleTakeCommand(const char *target) { - warning("STUB: handleTakeCommand"); + Common::String t(target); + + for (ObjList::const_iterator it = _world->_player->_currentScene->_objs.begin(); it != _world->_player->_currentScene->_objs.end(); ++it) { + Common::String n((*it)->_name); + n.toLowercase(); + + if (t.contains(n)) { + if ((*it)->_type == Obj::IMMOBILE_OBJECT) { + appendText((char *)"You can't move it."); + } else { + takeObj(*it); + } + break; + } + } } void Script::handleDropCommand(const char *target) { |