Ticket #2826: mi2-rope.diff

File mi2-rope.diff, 996 bytes (added by eriktorbjorn, 18 years ago)

Experimental patch

  • engines/scumm/object.cpp

     
    12251225
    12261226        debug(1, "Adding object %d from room %d into inventory", obj, room);
    12271227
    1228         if (whereIsObject(obj) == WIO_FLOBJECT) {
     1228        switch (whereIsObject(obj)) {
     1229        case WIO_INVENTORY:
     1230                // The object is already carried. This can happen when pulling
     1231                // the rope in Monkey Island 2. See bug #1555938.
     1232                return;
     1233        case WIO_FLOBJECT:
    12291234                idx = getObjectIndex(obj);
    12301235                assert(idx >= 0);
    12311236                ptr = getResourceAddress(rtFlObject, _objs[idx].fl_object_index) + 8;
    12321237                size = READ_BE_UINT32(ptr + 4);
    1233         } else {
     1238                break;
     1239        default:
    12341240                findObjectInRoom(&foir, foCodeHeader, obj, room);
    12351241                if (_game.features & GF_OLD_BUNDLE)
    12361242                        size = READ_LE_UINT16(foir.obcd);
     
    12391245                else
    12401246                        size = READ_BE_UINT32(foir.obcd + 4);
    12411247                ptr = foir.obcd;
     1248                break;
    12421249        }
    12431250
    12441251        slot = getInventorySlot();