Bug found in ui.c.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CJNyfalt
    Swordsman
    • May 2007
    • 289

    Bug found in ui.c.

    I found a bug in the region calculate function in ui.c.

    Code:
    region region_calculate(region loc)
    {
            int w, h;
            Term_get_size(&w, &h);
    
            if (loc.col < 0)
                    loc.col += w;
            if (loc.row < 0)
                    loc.row += w;
            if (loc.width <= 0)
                    loc.width += w - loc.col;
            if (loc.page_rows <= 0)
                    loc.page_rows += h - loc.row;
    
            return loc;
    }
    As you can see the action following the second if statement is incorrect. It should be:
    Code:
            if (loc.row < 0)
                    loc.row += h;
    That is add h(eight) not w(idth) to row.
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    #2
    Fixed- thanks.
    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

    Comment

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