Bash Damage assert bug

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • agoodman
    Apprentice
    • Jan 2011
    • 77

    Bash Damage assert bug

    If you have a str that gives negative damage and you bash and get to player-attack.c

    /* Encourage the player to keep wearing that heavy shield. */
    if (randint1(bash_dam) > 30 + randint1(bash_dam / 2)) {

    with bash_dam less than 0 you get an assert fail in Rand_div
    /* Division by zero will result if m is larger than 0x10000000 */
    assert(m <= 0x10000000);

    looks like this is a very old bug and only got seen because the stupid borg put on gloves of weakness and proceeded to attack (have to check into that part)

    Not sure if you want to induce a stumble in that case or just give a "fail to harm".
    Last edited by agoodman; April 27, 2024, 18:37.
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9592

    #2
    Fix is up, I went with just aborting the shield bash on negative damage.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

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