summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2017-05-02 19:20:57 +0200
committerBardur Arantsson <bardur@scientician.net>2017-05-02 19:20:57 +0200
commita40a0d1aeddb4742e486f601cbcc7e9ddcc06e2d (patch)
treeda5e8653050f47fc68f14d0062c11273774688e5 /src/main.cc
parentc2ff640e5540fd4c55dd054ae87dd510a11155e9 (diff)
Move player_{name,base} to Game
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/main.cc b/src/main.cc
index 9dd49aaa..3a08c6b0 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -76,16 +76,6 @@ static void init_save_dir(void)
}
}
-static void init_player_name()
-{
- /* Get the user id (?) */
- int player_uid = getuid();
-
- /* Acquire the "user name" as a default player name */
- user_name(player_name, player_uid);
-}
-
-
/*
* Initialize and verify the file paths, and the score file.
*
@@ -139,7 +129,7 @@ int main_real(int argc, char *argv[], char const *platform_sys, int (*init_platf
init_file_paths_with_env();
/* Initialize the player name */
- init_player_name();
+ game->player_name = user_name();
/* Make sure save directory exists */
init_save_dir();
@@ -179,8 +169,8 @@ int main_real(int argc, char *argv[], char const *platform_sys, int (*init_platf
case 'U':
{
if (!argv[i][2]) goto usage;
- strcpy(player_name, &argv[i][2]);
- strcpy(player_base, &argv[i][2]);
+ game->player_name = &argv[i][2];
+ game->player_base = &argv[i][2];
no_begin_screen = TRUE;
break;
}