Index: exec.c ================================================================== --- exec.c +++ exec.c @@ -1150,10 +1150,11 @@ static int connected_move(Uint32 obj,Uint8 dir) { Object*o; Uint32 n; Sint32 inertia=objects[obj]->inertia; Sint32 weight=0; + char bad; int first=nconn; int last; int i,j; if(nconn!=pconn) Throw("Improper nested connected move"); // Find and add all connections @@ -1172,11 +1173,14 @@ } } else { weight=objects[conn[first].obj]->weight; } last=pconn=nconn; + bad=0; // Check HIT/HITBY; may shove other objects + conn_dir=dir; + qsort(conn+first,last-first,sizeof(Connection),compare_connection); if(conn_option&0x02) { for(i=first;idir=dir,1); if(!j) goto fail; @@ -1189,18 +1193,19 @@ } for(i=first;iinertia=inertia; j=fake_move_dir(n,o->dir=dir,0); - if(!j) goto fail; + if(!j) bad=1; if((conn_option&0x01) && !(o->oflags&OF_DESTROYED)) inertia=o->inertia; if(j==2) { if(nconn==pconn) Throw("This object cannot be sticky"); i=pconn; goto loop1; } } + if(bad) goto fail; // Check if each object in the group is movable for(i=first;ix+x_delta[dir]),NVALUE(o->y+y_delta[dir]),NVALUE(0)))) goto fail; if(classes[o->class]->cflags&CF_PLAYER) { @@ -1213,12 +1218,10 @@ if(j=classes[o->class]->collisionLayers) { if(connection_collision(j,o->x+x_delta[dir],o->y+y_delta[dir])) goto fail; } } // Move everything in the group - conn_dir=dir; - qsort(conn+first,last-first,sizeof(Connection),compare_connection); for(i=first;ioflags&=~OF_VISUALONLY; if(move_to(obj,n,o->x+x_delta[dir],o->y+y_delta[dir])) o->oflags|=OF_MOVED; }