[3.3] Little miscalculation in randart frequency count for slays

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PowerWyrm
    Prophet
    • Apr 2008
    • 2986

    [3.3] Little miscalculation in randart frequency count for slays

    See randart.c

    In 3.2, the code was doing this:

    Code:
    flags_init(mask, OF_SIZE, OF_BRAND_MASK, FLAG_END);
    temp2 = list_slays(a_ptr->flags, mask, NULL, NULL, NULL, FALSE); 
    flags_init(mask, OF_SIZE, OF_ALL_SLAY_MASK, FLAG_END); 
    temp = list_slays(a_ptr->flags, mask, NULL, NULL, NULL, FALSE) - temp2;
    
    file_putf(log_file, "Adding %d for slays\n", temp);
    file_putf(log_file, "Adding %d for brands\n", temp2);
    
    artprobs[XXX_SLAY] += temp;
    artprobs[XXX_BRAND] += temp2;
    In 3.3, the code was changed to:

    Code:
    create_mask(mask, FALSE, OFT_SLAY, OFT_BRAND, OFT_KILL, OFT_MAX);
    temp = list_slays(flags, mask, NULL, NULL, NULL, FALSE);
    create_mask(mask, FALSE, OFT_BRAND, OFT_MAX);
    temp2 = list_slays(flags, mask, NULL, NULL, NULL, FALSE);
    
    file_putf(log_file, "Adding %d for slays\n", temp - temp2);
    file_putf(log_file, "Adding %d for brands\n", temp2);
    *** artprobs[XXX_SLAY] += temp; ***
    artprobs[XXX_BRAND] += temp2;
    I think the line with ***s should be changed to:

    artprobs[XXX_SLAY] += (temp - temp2);
    PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    #2
    Good catch, thank you. This will be fixed in 3.3.1
    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

    Comment

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