Index: class.c
==================================================================
--- class.c
+++ class.c
@@ -987,11 +987,11 @@
       switch(tokenv) {
         case OP_ADD: case OP_CLIMB: case OP_EIGHT: case OP_FOUR:
         case OP_HEIGHT: case OP_LOC: case OP_MARK: case OP_SUB:
         case OP_DIR: case OP_DIR_C: case OP_DIR_E: case OP_DIR_EC:
         case OP_OBJTOPAT: case OP_OBJBOTTOMAT: case OP_CUT: case OP_MUL:
-        case OP_OBJABOVE: case OP_OBJBELOW: case OP_TRACE:
+        case OP_OBJABOVE: case OP_OBJBELOW: case OP_TRACE: case OP_NEXT:
         case 0x0200 ... 0x02FF: // message
         case 0x4000 ... 0x7FFF: // class
         case 0xC000 ... 0xFFFF: // message
           cl->codes[ptr++]=tokenv;
           break;

Index: class.doc
==================================================================
--- class.doc
+++ class.doc
@@ -2152,10 +2152,13 @@
   Fail the match if the height here isn't greater than this number.
 
 if
   Begin a block that can optionally match.
 
+next
+  Unconditionally fail the current attempt and try the next choice.
+
 ObjAbove
   Match the object above the currently matched object.
 
 ObjBelow
   Match the object below the currently matched object.

Index: exec.c
==================================================================
--- exec.c
+++ exec.c
@@ -1558,12 +1558,12 @@
       y+=y_delta[code[ptr-1]];
       if(x<1 || x>pfwidth || y<1 || y>pfheight) goto fail;
       break;
     case 8 ... 15:
       n=VOIDLINK;
-      x+=x_delta[(code[ptr-1]+objects[obj]->dir)&7];
-      y+=y_delta[(code[ptr-1]+objects[obj]->dir)&7];
+      x+=x_delta[(code[ptr-1]+d)&7];
+      y+=y_delta[(code[ptr-1]+d)&7];
       if(x<1 || x>pfwidth || y<1 || y>pfheight) goto fail;
       break;
     case 0x0200 ... 0x02FF:
       g=code[ptr-1]&255;
       goto message;
@@ -1713,10 +1713,12 @@
     case OP_MUL:
       cp[cpi].x=x;
       cp[cpi].y=y;
       cp[cpi].dir=d;
       break;
+    case OP_NEXT:
+      goto fail;
     case OP_OBJABOVE:
       if(n==VOIDLINK) Throw("No object specified in pattern");
       n=obj_above(n);
       break;
     case OP_OBJBELOW: