From 8fbf0d8e1f9a53fca192056ae8ce81ed93212f2c Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 21 Apr 2002 02:05:04 +0000 Subject: [PATCH] James Hillers's bug fix. --- Makefile | 2 +- galaxis.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 9478d70..b21db20 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Note: When the version changes, you also have to change # the RPM spec file and the LSM. -VERS=1.2 +VERS=1.3 # Flags for use with the Linux ncurses package (recommended) CFLAGS = -g -DNDEBUG # -I/usr/local/include -L/usr/local/lib diff --git a/galaxis.c b/galaxis.c index 6bafa6f..22e3a58 100644 --- a/galaxis.c +++ b/galaxis.c @@ -3,6 +3,7 @@ * * version 1.0 by Eric S. Raymond Sun Oct 23 1994 * version 1.1 adds mouse support Wed Sep 20 1995 + * version 1.2 corrects buggy handling of multiple reprobes Sat Apr 20 2002 */ #define _POSIX_SOURCE @@ -538,7 +539,12 @@ static void auto_mark(cury, curx) static void drop_probe(int cury, int curx) /* drop a probe on the given spot */ { - if (board[cury][curx] & S_LIFEBOAT) + if (board[cury][curx] & S_BOATSEEN) + { + prompt("This lifeboat is already visible."); + beep(); + } + else if (board[cury][curx] & S_LIFEBOAT) { board[cury][curx] |= S_BOATSEEN; prompt("You found a lifeboat!"); @@ -546,11 +552,6 @@ static void drop_probe(int cury, int curx) turn++; boatsfound++; } - else if (board[cury][curx] & S_BOATSEEN) - { - prompt("This lifeboat is already visible."); - beep(); - } else { int visibles, total; -- 2.43.0