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:
parent
d23111daba
commit
7eaefce61d
5 changed files with 31 additions and 25 deletions
8
init.c
8
init.c
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue