diff --git a/engines/agi/checks.cpp b/engines/agi/checks.cpp
index c3b31f6..a13ee2f 100644
a
|
b
|
void AgiEngine::fixPosition(int n) {
|
282 | 282 | dir = 0; |
283 | 283 | count = size = 1; |
284 | 284 | |
285 | | while (!checkPosition(v) || checkCollision(v) || !checkPriority(v)) { |
| 285 | while (shouldQuit() && (!checkPosition(v) || checkCollision(v) || !checkPriority(v))) { |
286 | 286 | switch (dir) { |
287 | 287 | case 0: // west |
288 | 288 | v->xPos--; |
289 | | if (--count) |
| 289 | if (count && --count) |
290 | 290 | continue; |
291 | 291 | dir = 1; |
292 | 292 | break; |
293 | 293 | case 1: // south |
294 | 294 | v->yPos++; |
295 | | if (--count) |
| 295 | if (count && --count) |
296 | 296 | continue; |
297 | 297 | dir = 2; |
298 | 298 | size++; |
299 | 299 | break; |
300 | 300 | case 2: // east |
301 | 301 | v->xPos++; |
302 | | if (--count) |
| 302 | if (count && --count) |
303 | 303 | continue; |
304 | 304 | dir = 3; |
305 | 305 | break; |
306 | 306 | case 3: // north |
307 | 307 | v->yPos--; |
308 | | if (--count) |
| 308 | if (count && --count) |
309 | 309 | continue; |
310 | 310 | dir = 0; |
311 | 311 | size++; |