Ticket #9229: walkbox-ladder.patch

File walkbox-ladder.patch, 1.2 KB (added by SF/tobigun, 14 years ago)

Ladder actor-facing patch

  • actor.cpp

     
    691691int Actor::remapDirection(int dir, bool is_walking) {
    692692        int specdir;
    693693        byte flags;
     694        byte mask;
    694695        bool flipX;
    695696        bool flipY;
    696697
     
    769770                case 6:
    770771                        return 180;
    771772                }
     773
     774                // MM C64 stores flags as a part of the mask
     775                if (_vm->_game.version == 0) {
     776                        mask = _vm->getMaskFromBox(_walkbox);
     777                        // face the wall if climbing/descending a ladder
     778                        if ((mask & 0x8C) == 0x84)
     779                                return 0;
     780                }
    772781        }
    773782        // OR 1024 in to signal direction interpolation should be done
    774783        return normalizeAngle(dir) | 1024;
  • boxes.cpp

     
    614614                box->lr.x = bp->c64.x2;
    615615                box->lr.y = bp->c64.y2;
    616616
    617                 if (bp->c64.mask & 0x88) {
     617                if ((bp->c64.mask & 0x88) == 0x88) {
    618618                        // walkbox for (right/left) corner
    619                         // TODO: ladders (incl. man-eating plant) have mask 0x8A,
    620                         // must those walkboxes be adjusted?
    621619                        if (bp->c64.mask & 0x04)
    622620                                box->ur = box->ul;
    623621                        else