From 3cdc17be949ba72ee185f2c33e1f1949a08a0054 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 21 Jan 2016 14:38:15 +0100 Subject: [PATCH] WAGE: Implement handleTakeCommand() --- engines/wage/script.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp index ee70709f43d..578267f75f6 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) {