Connected stairs option does not save

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • calris
    Adept
    • Mar 2016
    • 194

    Connected stairs option does not save

    Playing the latest Traps branch (i.e. with Rune ID) I notice the 'Generate Connected Stairs' option keeps resetting to 'Yes' after saving
  • t4nk
    Swordsman
    • May 2016
    • 336

    #2
    Yeah, I'm playing master and I noticed that too. That's because the string "birth_connect_stairs" is 20 bytes long (not counting the terminating null byte). But the options loader (rd_options() in load.c) has only 20 byte buffer (lines 396-406):
    Code:
        while (1) {
            byte value;
            char name[20];
            rd_string(name, sizeof name);
    
            if (!name[0])
                break;
    
            rd_byte(&value);
            option_set(name, !!value);
        }
    and rd_string() does (line 302 of savefile.c):
    Code:
    void rd_string(char *str, int max)
    {
        ...
        str[max - 1] = '\0';
    }
    so name turns out to be "birth_connect_stair" (without "s" at the end).
    I didn't find a ticket on trac.rephial.org; perhaps thats already fixed?

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9637

      #3
      Originally posted by t4nk
      I didn't find a ticket on trac.rephial.org; perhaps thats already fixed?
      You vastly overestimate how organised our ticketing is. Now fixed in development.
      One for the Dark Lord on his dark throne
      In the Land of Mordor where the Shadows lie.

      Comment

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