aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-01-22 16:22:19 +0100
committerEugene Sandulenko2016-02-14 17:12:51 +0100
commit605a32d9bf8407931eac52b7960b2c7b011f08e8 (patch)
tree0b604bd831decfcafe4faca17f22ac5de29c8063
parent42c74403760365258a4841cd139aa69be43328c7 (diff)
downloadscummvm-rg350-605a32d9bf8407931eac52b7960b2c7b011f08e8.tar.gz
scummvm-rg350-605a32d9bf8407931eac52b7960b2c7b011f08e8.tar.bz2
scummvm-rg350-605a32d9bf8407931eac52b7960b2c7b011f08e8.zip
WAGE: Implement wearObj()
-rw-r--r--engines/wage/script.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp
index 51fb40eaa9..6ca3ecbbe3 100644
--- a/engines/wage/script.cpp
+++ b/engines/wage/script.cpp
@@ -1206,7 +1206,22 @@ void Script::handleWearCommand(const char *t) {
}
void Script::wearObj(Obj *o, int pos) {
- warning("STUB: wearObj()");
+ Chr *player = _world->_player;
+ char buf[512];
+
+ if (player->_armor[pos] == o) {
+ snprintf(buf, 512, "You are already wearing the %s.", o->_name.c_str());
+ appendText(buf);
+ } else {
+ if (player->_armor[pos] != NULL) {
+ snprintf(buf, 512, "You are no longer wearing the %s.", player->_armor[pos]->_name.c_str());
+ appendText(buf);
+ }
+
+ player->_armor[pos] = o;
+ snprintf(buf, 512, "You are now wearing the %s.", o->_name.c_str());
+ appendText(buf);
+ }
}