aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/wage/script.cpp16
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) {