comparison xrogue/fight.c @ 140:856017d63519

xrogue: don't segfault when backstabbing while empty-handed. The code for backstabbing checked the weapon's properties without making sure it was not NULL.
author John "Elwin" Edwards
date Tue, 05 May 2015 12:12:20 -0400
parents e6179860cb76
children f54901b9c39b
comparison
equal deleted inserted replaced
139:0d151573bdb0 140:856017d63519
675 (weap && att != &pstats && on(*att_er, CANBSTAB))) { 675 (weap && att != &pstats && on(*att_er, CANBSTAB))) {
676 int mult = 2 + (att->s_lvl-1)/4; /* Normal multiplier */ 676 int mult = 2 + (att->s_lvl-1)/4; /* Normal multiplier */
677 677
678 if (mult > 5) 678 if (mult > 5)
679 mult = 5; 679 mult = 5;
680 if (weap->o_type == RELIC && weap->o_which == MUSTY_DAGGER) 680 if (weap && weap->o_type == RELIC &&
681 weap->o_which == MUSTY_DAGGER)
681 mult++; 682 mult++;
682 damage *= mult; 683 damage *= mult;
683 } 684 }
684 if (att == &pstats) { 685 if (att == &pstats) {
685 if (cur_weapon && (cur_weapon->o_flags & ISPOISON)) { 686 if (cur_weapon && (cur_weapon->o_flags & ISPOISON)) {