diff options
author | Johannes Schickel | 2005-12-31 15:41:37 +0000 |
---|---|---|
committer | Johannes Schickel | 2005-12-31 15:41:37 +0000 |
commit | a10097eaa41357beb2dc4be4f790717fe9fe70a3 (patch) | |
tree | 8c7fb60b2764b8b0b0e58ac665bbd3c374241514 | |
parent | 5afaad7869a252cabde3f8ec24957ca1e7c1684a (diff) | |
download | scummvm-rg350-a10097eaa41357beb2dc4be4f790717fe9fe70a3.tar.gz scummvm-rg350-a10097eaa41357beb2dc4be4f790717fe9fe70a3.tar.bz2 scummvm-rg350-a10097eaa41357beb2dc4be4f790717fe9fe70a3.zip |
Commited patches 1394374 and 1394374 with minor changes.
Thanks to clemmy for that.
svn-id: r19870
-rw-r--r-- | kyra/debugger.cpp | 19 | ||||
-rw-r--r-- | kyra/kyra.cpp | 2 | ||||
-rw-r--r-- | kyra/kyra.h | 10 | ||||
-rw-r--r-- | kyra/script_v1.cpp | 9 |
4 files changed, 29 insertions, 11 deletions
diff --git a/kyra/debugger.cpp b/kyra/debugger.cpp index 036c884af6..fa0207035f 100644 --- a/kyra/debugger.cpp +++ b/kyra/debugger.cpp @@ -59,9 +59,15 @@ bool Debugger::cmd_enterRoom(int argc, const char **argv) { if (argc > 1) { uint room = atoi(argv[1]); - if (argc > 2) + // game will crash if entering a non-existent room + if (room >= _vm->_roomTableSize) { + DebugPrintf("room number must be any value between (including) 0 and %d\n", _vm->_roomTableSize-1); + return true; + } + + if (argc > 2) { direction = atoi(argv[2]); - else { + } else { if (_vm->_roomTable[room].northExit != 0xff) direction = 3; else if (_vm->_roomTable[room].eastExit != 0xff) @@ -178,8 +184,15 @@ bool Debugger::cmd_setTimerCountdown(int argc, const char **argv) { } bool Debugger::cmd_giveItem(int argc, const char **argv) { - if (argc) { + if (argc == 2) { int item = atoi(argv[1]); + + // Kyrandia 1 has only 108 items (-1 to 106), otherwise it will crash + if (item < -1 || item > 106) { + DebugPrintf("itemid must be any value between (including) -1 and 106\n"); + return true; + } + _vm->setMouseItem(item); _vm->_itemInHand = item; } else diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp index 96243c730e..da496cf88c 100644 --- a/kyra/kyra.cpp +++ b/kyra/kyra.cpp @@ -351,6 +351,8 @@ int KyraEngine::init(GameDetector &detector) { _fadeText = false; _noDrawShapesFlag = 0; + _cauldronState = 0; + _brandonStatusBit = 0; _brandonStatusBit0x02Flag = _brandonStatusBit0x20Flag = 10; _brandonPosX = _brandonPosY = -1; diff --git a/kyra/kyra.h b/kyra/kyra.h index cc5e0920a4..878f51dd4f 100644 --- a/kyra/kyra.h +++ b/kyra/kyra.h @@ -679,12 +679,14 @@ protected: Rect _noDropRects[11]; - uint16 _birthstoneGemTable[4]; - uint8 _idolGemsTable[3]; + int8 _birthstoneGemTable[4]; + int8 _idolGemsTable[3]; - int16 _marbleVaseItem; - int16 _foyerItemTable[3]; + int8 _marbleVaseItem; + int8 _foyerItemTable[3]; + int8 _cauldronState; + uint16 _brandonStatusBit; int _brandonStatusBit0x02Flag; int _brandonStatusBit0x20Flag; diff --git a/kyra/script_v1.cpp b/kyra/script_v1.cpp index 1cbb354028..8a28ad6837 100644 --- a/kyra/script_v1.cpp +++ b/kyra/script_v1.cpp @@ -1702,13 +1702,14 @@ int KyraEngine::cmd_itemOnGroundHere(ScriptState *script) { } int KyraEngine::cmd_queryCauldronState(ScriptState *script) { - warning("STUB: cmd_queryCauldronState"); - return 0; + debug(3, "cmd_queryCauldronState(0x%X) ()", script); + return _cauldronState; } int KyraEngine::cmd_setCauldronState(ScriptState *script) { - warning("STUB: cmd_setCauldronState"); - return 0; + debug(3, "cmd_setCauldronState(0x%X) (%d)", script, stackPos(0)); + _cauldronState = stackPos(0); + return _cauldronState; } int KyraEngine::cmd_queryCrystalState(ScriptState *script) { |