Player's options are not restored (from savefile) when creating a new chars

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • t4nk
    Swordsman
    • May 2016
    • 336

    Player's options are not restored (from savefile) when creating a new chars

    Now options are in struct player, which gets memset in player_init() (player-birth.c):
    Code:
        /* Wipe the player */
        memset(p, 0, sizeof(struct player));
    So all options are reset to 0. Then options_init_defaults() is called (also from player_init()). Note that player_init() is called after trying to load savefile (ui-game.c):
    Code:
        /* Try loading */
        if (file_exists(savefile) && !savefile_load(savefile, arg_wizard))
            quit("Broken savefile");
    
        /* No living character loaded */
        if (player->is_dead || new_game) {
            character_generated = false;
            textui_do_birth();
        }
    textui_do_birth() calls player_init() via do_cmd_birth_reset().
    Is it working as designed? I'd prefer the game to remember my options (roguelike keyset, etc), like it did before, even if I'm creating a new char.
  • Carnivean
    Knight
    • Sep 2013
    • 527

    #2
    New characters could be for a new user, so the slate is left clean. Descendants of an existing character get the options for the ancestor's player.

    Comment

    • takkaria
      Veteran
      • Apr 2007
      • 1951

      #3
      Thanks, I've submitted a pull request that fixes this behaviour now.
      takkaria whispers something about options. -more-

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9637

        #4
        Originally posted by takkaria
        Thanks, I've submitted a pull request that fixes this behaviour now.
        ...aaaand it's in the latest nightly build.
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        Working...
        😀
        😂
        🥰
        😘
        🤢
        😎
        😞
        😡
        👍
        👎