projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Localize scope for restore file pointer in main.
[open-adventure.git]
/
main.c
diff --git
a/main.c
b/main.c
index 766082b13bf481d348417ffb9dc2de9b7576b8d5..345a7b23343daa4d55b5ab96bdf43036498c612d 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-25,7
+25,7
@@
#define DIM(a) (sizeof(a)/sizeof(a[0]))
#define DIM(a) (sizeof(a)/sizeof(a[0]))
-FILE
*logfp = NULL, *r
fp = NULL;
+FILE
*log
fp = NULL;
bool oldstyle = false;
bool prompt = true;
bool oldstyle = false;
bool prompt = true;
@@
-61,8
+61,9
@@
int main(int argc, char *argv[])
/* Options. */
#ifndef ADVENT_NOSAVE
/* Options. */
#ifndef ADVENT_NOSAVE
- const char* opts = "l:or";
+ const char* opts = "l:or
:
";
const char* usage = "Usage: %s [-l logfilename] [-o] [-r restorefilename]\n";
const char* usage = "Usage: %s [-l logfilename] [-o] [-r restorefilename]\n";
+ FILE *rfp = NULL;
#else
const char* opts = "l:o";
const char* usage = "Usage: %s [-l logfilename] [-o]\n";
#else
const char* opts = "l:o";
const char* usage = "Usage: %s [-l logfilename] [-o]\n";
@@
-110,9
+111,6
@@
int main(int argc, char *argv[])
/* Initialize game variables */
long seedval = initialise();
/* Initialize game variables */
long seedval = initialise();
- /* Start-up, dwarf stuff */
- make_zzword(game.zzword);
-
#ifndef ADVENT_NOSAVE
if (!rfp) {
game.novice = yes(arbitrary_messages[WELCOME_YOU], arbitrary_messages[CAVE_NEARBY], arbitrary_messages[NO_MESSAGE]);
#ifndef ADVENT_NOSAVE
if (!rfp) {
game.novice = yes(arbitrary_messages[WELCOME_YOU], arbitrary_messages[CAVE_NEARBY], arbitrary_messages[NO_MESSAGE]);
@@
-144,8
+142,6
@@
static bool fallback_handler(char *buf)
printf("Seed set to %ld\n", sv);
// autogenerated, so don't charge user time for it.
--game.turns;
printf("Seed set to %ld\n", sv);
// autogenerated, so don't charge user time for it.
--game.turns;
- // here we reconfigure any global game state that uses random numbers
- make_zzword(game.zzword);
return true;
}
return false;
return true;
}
return false;