Moved application settings to settings_t struct

Since logfp, oldstyle, and prompt were application settings, rather than
have them all as global vars, move them to a single global var, seperate
from game state, as they aren't, technically, game state, but are
application settings.
This commit is contained in:
Aaron Traas 2017-07-02 02:46:04 -04:00 committed by Eric S. Raymond
parent d23111daba
commit 7eaefce61d
5 changed files with 31 additions and 25 deletions

8
init.c
View file

@ -10,6 +10,12 @@
* Initialisation
*/
struct settings_t settings = {
.logfp = NULL,
.oldstyle = false,
.prompt = true
};
struct game_t game = {
.dloc[1] = LOC_KINGHALL,
.dloc[2] = LOC_WESTBANK,
@ -41,7 +47,7 @@ struct game_t game = {
long initialise(void)
{
if (oldstyle)
if (settings.oldstyle)
printf("Initialising...\n");
srand(time(NULL));