From 05f68b17d4a60ece9e2eed14746eab5b29a3e688 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 9 Mar 2008 14:46:24 +0000 Subject: - implemented cauldron handling for HoF (needs some more testing though) - fixed bug in updateCharFacing - added 'give' command to HoF debugger, which allows setting the hand item to a specified item svn-id: r31087 --- engines/kyra/debugger.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'engines/kyra/debugger.cpp') diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index d44fcb3b81..194633ec68 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -234,6 +234,7 @@ Debugger_v2::Debugger_v2(KyraEngine_v2 *vm) : Debugger(vm), _vm(vm) { DCmd_Register("scenes", WRAP_METHOD(Debugger_v2, cmd_listScenes)); DCmd_Register("scene_info", WRAP_METHOD(Debugger_v2, cmd_sceneInfo)); DCmd_Register("scene_to_facing", WRAP_METHOD(Debugger_v2, cmd_sceneToFacing)); + DCmd_Register("give", WRAP_METHOD(Debugger_v2, cmd_giveItem)); } bool Debugger_v2::cmd_enterScene(int argc, const char **argv) { @@ -359,5 +360,23 @@ bool Debugger_v2::cmd_sceneToFacing(int argc, const char **argv) { return true; } +bool Debugger_v2::cmd_giveItem(int argc, const char **argv) { + if (argc == 2) { + int item = atoi(argv[1]); + + // Kyrandia 2 has only 178 items (-1 to 176), otherwise it will crash + if (item < -1 || item > 176) { + DebugPrintf("itemid must be any value between (including) -1 and 176\n"); + return true; + } + + _vm->setHandItem(item); + } else { + DebugPrintf("Syntax: give \n"); + } + + return true; +} + } // End of namespace Kyra -- cgit v1.2.3