Ticket #8497: kyra_debuger_fix.diff

File kyra_debuger_fix.diff, 1.2 KB (added by SF/clemty, 15 years ago)

diff file for the kyra debugger

  • debugger.

    old new  
    5959        if (argc > 1) {
    6060                uint room = atoi(argv[1]);
    6161
     62                /* Kyrandia 1 has only 246 rooms (0-245), otherwise it'll crash */
     63                if ((room<0) || (room>245)) {
     64                        DebugPrintf("room number must be any value between (including) 0 and 245\n");
     65                        return true;
     66                        }
     67
    6268                if (argc > 2)
    6369                        direction = atoi(argv[2]);
    6470                else {
     
    7278                                direction = 2;
    7379                }
    7480
     81                /* for some reason rooms 53 and 54 in Kyrandia 1 will not display Brandon if no direction is given */
     82                if (((room==53) || (room==54)) && argc == 2) direction = 2;
     83
    7584                // Dirty way of hiding the debug console while the room entry scripts are running,
    7685                // otherwise the graphics didn't update.
    7786                _vm->_system->hideOverlay();
     
    180189bool Debugger::cmd_giveItem(int argc, const char **argv) {
    181190        if (argc) {
    182191                int item = atoi(argv[1]);
     192
     193                /* Kyrandia 1 has only 107 rooms (0-106), otherwise it'll crash */
     194                if ((item<0) || (item>106)) {
     195                        DebugPrintf("itemid must be any value between (including) 0 and 106\n");
     196                        return true;
     197                        }
     198
    183199                _vm->setMouseItem(item);
    184200                _vm->_itemInHand = item;
    185201        } else