*************** *** 607,613 **** { sc_printfilterref_t filter = gamestate->filter; sc_gamestateref_t undo = gamestate->undo; ! sc_char buffer[11]; assert (gs_is_gamestate_valid (undo)); /* Do nothing if no undo available, or if notification is off. */ --- 607,613 ---- { sc_printfilterref_t filter = gamestate->filter; sc_gamestateref_t undo = gamestate->undo; ! sc_char buffer[12]; assert (gs_is_gamestate_valid (undo)); /* Do nothing if no undo available, or if notification is off. */ *************** *** 665,670 **** sc_printfilterref_t filter = gamestate->filter; sc_prop_setref_t bundle = gamestate->bundle; sc_char line_element[LINE_BUFFER_SIZE]; sc_bool rerunning; sc_char *filtered; --- 665,671 ---- sc_printfilterref_t filter = gamestate->filter; sc_prop_setref_t bundle = gamestate->bundle; + sc_var_setref_t vars = gamestate->vars; sc_char line_element[LINE_BUFFER_SIZE]; sc_bool rerunning; sc_char *filtered; *************** *** 768,773 **** sc_char *message; /* Command line not understood. */ vt_key[0].string = "Globals"; vt_key[1].string = "DontUnderstand"; message = prop_get_string (bundle, "S<-ss", vt_key); --- 769,775 ---- sc_char *message; /* Command line not understood. */ + var_set_ref_text (vars, line_element); vt_key[0].string = "Globals"; vt_key[1].string = "DontUnderstand"; message = prop_get_string (bundle, "S<-ss", vt_key); *************** *** 861,866 **** sc_printfilterref_t filter = gamestate->filter; sc_var_setref_t vars = gamestate->vars; sc_prop_setref_t bundle = gamestate->bundle; /* * See if this is the very start of a new game. If the turns --- 863,872 ---- sc_printfilterref_t filter = gamestate->filter; sc_var_setref_t vars = gamestate->vars; sc_prop_setref_t bundle = gamestate->bundle; + sc_bool promptname; + sc_char playername[50]; + sc_char *plyrnm; + /* * See if this is the very start of a new game. If the turns *************** *** 869,875 **** */ if (gamestate->turns == 0) { ! sc_vartype_t vt_key[2]; sc_char *gamename, *startuptext; sc_bool disp_first_room, battle_system; --- 875,881 ---- */ if (gamestate->turns == 0) { ! sc_vartype_t vt_key[2], vt_val; sc_char *gamename, *startuptext; sc_bool disp_first_room, battle_system; *************** *** 894,899 **** pf_buffer_string (filter, gamename); pf_buffer_character (filter, '\n'); /* Print the game header. */ vt_key[0].string = "Header"; vt_key[1].string = "StartupText"; --- 900,922 ---- pf_buffer_string (filter, gamename); pf_buffer_character (filter, '\n'); + /* Prompt for player name if necessary */ + vt_key[1].string = "PromptName"; + promptname = prop_get_boolean(bundle, "B<-ss", vt_key); + if ( promptname ) + { os_prompt_string("What is your name? ", + playername,49); + plyrnm = strdup(playername); + if ( ! plyrnm ) + { sc_fatal("Unable to malloc plyrnm"); + } + vt_key[1].string="PlayerName"; + vt_val.string = plyrnm; + prop_put(bundle,"S->ss",vt_val,vt_key); + } + + + /* Print the game header. */ vt_key[0].string = "Header"; vt_key[1].string = "StartupText";