projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
624ba16
)
Remove message pointer math in croak().
author
Jason S. Ninneman
<jsn@mbar.us>
Mon, 19 Jun 2017 02:54:48 +0000
(19:54 -0700)
committer
Jason S. Ninneman
<jsn@mbar.us>
Mon, 19 Jun 2017 02:54:48 +0000
(19:54 -0700)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index dd9d5c1ffae9f836a9f494d6f724d43d6a7607a0..7e30f4eb0797a87855fe9caf8ca7f10941afae8d 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-490,6
+490,8
@@
static bool dwarfmove(void)
static void croak(void)
/* Okay, he's dead. Let's get on with it. */
{
static void croak(void)
/* Okay, he's dead. Let's get on with it. */
{
+ const char* query = obituaries[game.numdie].query;
+ const char* yes_response = obituaries[game.numdie].yes_response;
++game.numdie;
if (game.closng) {
/* He died during closing time. No resurrection. Tally up a
++game.numdie;
if (game.closng) {
/* He died during closing time. No resurrection. Tally up a
@@
-497,8
+499,7
@@
static void croak(void)
RSPEAK(DEATH_CLOSING);
terminate(endgame);
}
RSPEAK(DEATH_CLOSING);
terminate(endgame);
}
- /* FIXME: Arithmetic on message numbers */
- else if (game.numdie == MAXDIE || !YES(arbitrary_messages[WATCH_IT + game.numdie * 2], arbitrary_messages[WHICH_WAY + game.numdie * 2], arbitrary_messages[OK_MAN]))
+ else if (game.numdie == maximum_deaths || !YES(query, yes_response, arbitrary_messages[OK_MAN]))
terminate(endgame);
else {
game.place[WATER] = game.place[OIL] = NOWHERE;
terminate(endgame);
else {
game.place[WATER] = game.place[OIL] = NOWHERE;