sil 1.1: minor bug with thrown weapons

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bron
    Knight
    • May 2008
    • 515

    sil 1.1: minor bug with thrown weapons

    I've noticed that sometimes the "attack to-hit" modifier for a thrown weapon is higher than it should be. I looked into this, and it appears the trouble is that when the character is wielding a melee weapon for which they have "affinity", that extra +1 for the melee weapon is not subtracted from the modifier for the thrown weapon. Thus, if a Noldor is wielding a sword and then throws a spear, the spear gets the benefit of the +1 sword affinity modifier.

    More precisely: in cmd2.c, routine do_cmd_throw, it has:

    Code:
            ...
            attack_mod = p_ptr->skill_use[S_MEL] + i_ptr->att;
    
            // subtract out the melee weapon's bonus (as we had already accounted for it)
            attack_mod -= (&inventory[INVEN_WIELD])->att;
            ...
    This removes the wielded weapon's attack modifier, as is only proper, but only the modifier on the weapon itself. The code should also subtract the melee weapon affinity bonus (if any) at this point, but does not.
  • half
    Knight
    • Jan 2009
    • 910

    #2
    Well spotted!

    This is an advantage of having a combat rolls window. Presumably bugs like this would never be spotted in most games. Of course with all the different combinations of abilities and affinities, Sil has more opportunities for bugs like this to arise.

    I've added it to the bugs list.

    Comment

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