aboutsummaryrefslogtreecommitdiff
path: root/engines/mads
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads')
-rw-r--r--engines/mads/debugger.cpp18
-rw-r--r--engines/mads/debugger.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/engines/mads/debugger.cpp b/engines/mads/debugger.cpp
index 276340f240..7d66b56989 100644
--- a/engines/mads/debugger.cpp
+++ b/engines/mads/debugger.cpp
@@ -38,6 +38,7 @@ Debugger::Debugger(MADSEngine *vm) : GUI::Debugger(), _vm(vm) {
DCmd_Register("show_codes", WRAP_METHOD(Debugger, Cmd_ShowCodes));
DCmd_Register("dump_file", WRAP_METHOD(Debugger, Cmd_DumpFile));
DCmd_Register("show_quote", WRAP_METHOD(Debugger, Cmd_ShowQuote));
+ DCmd_Register("item", WRAP_METHOD(Debugger, Cmd_Item));
}
static int strToInt(const char *s) {
@@ -178,4 +179,21 @@ bool Debugger::Cmd_ShowQuote(int argc, const char **argv) {
return true;
}
+bool Debugger::Cmd_Item(int argc, const char **argv) {
+ InventoryObjects &objects = _vm->_game->_objects;
+
+ if (argc != 2) {
+ DebugPrintf("Usage: %s <item number>\n", argv[0]);
+ return true;
+ } else {
+ int objectId = strToInt(argv[1]);
+
+ if (!objects.isInInventory(objectId))
+ objects.addToInventory(objectId);
+
+ DebugPrintf("Item added.\n");
+ return false;
+ }
+}
+
} // End of namespace MADS
diff --git a/engines/mads/debugger.h b/engines/mads/debugger.h
index b2b0949923..c2d66d9118 100644
--- a/engines/mads/debugger.h
+++ b/engines/mads/debugger.h
@@ -42,6 +42,7 @@ protected:
bool Cmd_ShowCodes(int argc, const char **argv);
bool Cmd_DumpFile(int argc, const char **argv);
bool Cmd_ShowQuote(int argc, const char **argv);
+ bool Cmd_Item(int argc, const char **argv);
public:
bool _showMousePos;
public: