From acc53772d30828b53555695b5a70ddc4b7149ee0 Mon Sep 17 00:00:00 2001 From: jdc Date: Tue, 6 Apr 2004 19:15:07 +0000 Subject: If the current player has no cards, skip to the other player. While we're here, make this compile with -DDEBUG. Fixes PR bin/12530 from Thomas Klausner. --- mille/move.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mille/move.c b/mille/move.c index 1cfa7a0e..caca78c1 100644 --- a/mille/move.c +++ b/mille/move.c @@ -1,4 +1,4 @@ -/* $NetBSD: move.c,v 1.13 2003/08/07 09:37:25 agc Exp $ */ +/* $NetBSD: move.c,v 1.14 2004/04/06 19:15:07 jdc Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,12 +34,16 @@ #if 0 static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: move.c,v 1.13 2003/08/07 09:37:25 agc Exp $"); +__RCSID("$NetBSD: move.c,v 1.14 2004/04/06 19:15:07 jdc Exp $"); #endif #endif /* not lint */ #include +#ifdef DEBUG +#include +#endif + #include "mille.h" #ifndef unctrl #include "unctrl.h" @@ -60,6 +64,13 @@ domove() bool goodplay; pp = &Player[Play]; + for (i = 0, j = 0; i < HAND_SZ; i++) + if (pp->hand[i] != -1) + j++; + if (!j) { + nextplay(); + return; + } if (Play == PLAYER) getmove(); else @@ -426,10 +437,12 @@ getmove() case 'Z': /* Debug code */ if (!Debug && outf == NULL) { char buf[MAXPATHLEN]; + char *sp; prompt(FILEPROMPT); leaveok(Board, FALSE); refresh(); +over: sp = buf; while ((*sp = readch()) != '\n') { if (*sp == killchar()) -- cgit v1.2.3-56-ge451