Bash Damage assert bug

  • Time
  • Show
Clear All
new posts
  • agoodman
    • Jan 2011
    • 85

    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
    • 9596

    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.