Thread: 4.0.2 Bugs
View Single Post
Old October 26, 2015, 17:33   #176
Werbaer
Adept
 
Join Date: Aug 2014
Posts: 143
Werbaer is on a distinguished road
Auotload character from command line:

In 3.5.0, in main_win.c:
Code:
static void check_for_save_file(LPSTR cmd_line)
{
    [...]
	/* Set the command now so that we skip the "Open File" prompt. */
	cmd.command = CMD_LOADFILE;
}
In 4.0.0, in main_win.c:
Code:
static void check_for_save_file(LPSTR cmd_line)
{
    [...]
	/* Start game */
	game_in_progress = TRUE;
	Term_fresh();
	play_game(FALSE);
	quit(NULL);
}
But take a look at the caller win_main() in main_win.c:
Code:
	/* Did the user double click on a save file? */
	check_for_save_file(lpCmdLine);

	/* Set command hook */
	cmd_get_hook = textui_get_cmd;

	/* Set up the display handlers and things. */
	init_display();
	init_angband();

	textui_init();

	initialized = TRUE;
check_for_save_file() is called before the various intialisation functions are executed. The was ok in the past, when it only set a command variable. Now that it tries to run the game immediately, this call needs to be moved after the initialisation is complete.
Werbaer is offline   Reply With Quote