Ticket #5916: agi-fix-clean.patch

File agi-fix-clean.patch, 900 bytes (added by digitall, 12 years ago)

Just the fix Patch

  • engines/agi/checks.cpp

    diff --git a/engines/agi/checks.cpp b/engines/agi/checks.cpp
    index c3b31f6..a13ee2f 100644
    a b void AgiEngine::fixPosition(int n) {  
    282282        dir = 0;
    283283        count = size = 1;
    284284
    285         while (!checkPosition(v) || checkCollision(v) || !checkPriority(v)) {
     285        while (shouldQuit() && (!checkPosition(v) || checkCollision(v) || !checkPriority(v))) {
    286286                switch (dir) {
    287287                case 0: // west
    288288                        v->xPos--;
    289                         if (--count)
     289                        if (count && --count)
    290290                                continue;
    291291                        dir = 1;
    292292                        break;
    293293                case 1: // south
    294294                        v->yPos++;
    295                         if (--count)
     295                        if (count && --count)
    296296                                continue;
    297297                        dir = 2;
    298298                        size++;
    299299                        break;
    300300                case 2: // east
    301301                        v->xPos++;
    302                         if (--count)
     302                        if (count && --count)
    303303                                continue;
    304304                        dir = 3;
    305305                        break;
    306306                case 3: // north
    307307                        v->yPos--;
    308                         if (--count)
     308                        if (count && --count)
    309309                                continue;
    310310                        dir = 0;
    311311                        size++;