- register int n;
- register struct snag *s = to->file->fouls;
-
- Write(W_FOUL, from, 0, which, 0, 0, 0);
- for (n = 0; n < NSHIP && (s->turnfoul || s->toship != from); n++, s++)
- ;
- if (n < NSHIP)
- Write(W_FOUL, to, 0, n, 0, 0, 0);
- if (!snagged2(from, to)) {
- if (!fouled(from) && !grappled(from)) {
- unboard(from, from, 1); /* defense */
- unboard(from, from, 0); /* defense */
- } else
- unboard(from, to, 0); /* defense */
- if (!fouled(to) && !grappled(to)) { /* defense */
- unboard(to, to, 1);
- unboard(to, to, 0);
- } else
- unboard(to, from, 0); /* offense */
+ if (flag & 1) {
+ Write(W_UNGRAP, from, 0, to->file->index, all, 0, 0);
+ Write(W_UNGRAP, to, 0, from->file->index, all, 0, 0);
+ }
+ if (flag & 2) {
+ Write(W_UNFOUL, from, 0, to->file->index, all, 0, 0);
+ Write(W_UNFOUL, to, 0, from->file->index, all, 0, 0);