Fix: SE043 Problem: Thowing darts, daggers etc when not wielding a weapon causes a segmentation fault. Reported by: Peter Makholm, peter@makholm.net Compatible with: Slash'EM 0.0.6E0 Author: J. Ali Harlow, ali@avrc.city.ac.uk Date: 18 Jan 2000 *** src/dothrow.c.orig Mon Jan 17 13:29:50 2000 --- src/dothrow.c Tue Jan 18 15:10:03 2000 *************** *** 103,112 **** /* ...or is using a good weapon... */ /* Elven Craftsmanship makes for light, quick bows */ if (obj->otyp == ELVEN_ARROW && !obj->cursed && !rn2(3)) multishot++; ! if (launcher->otyp == ELVEN_BOW && !launcher->cursed && !rn2(3)) multishot++; /* 1/3 of object enchantment */ ! if (launcher->spe > 1) multishot += (long) rounddiv(launcher->spe,3); /* ...or is using a special weapon for their role... */ switch (Role_switch) { --- 103,115 ---- /* ...or is using a good weapon... */ /* Elven Craftsmanship makes for light, quick bows */ if (obj->otyp == ELVEN_ARROW && !obj->cursed && !rn2(3)) multishot++; ! if (launcher && launcher->otyp == ELVEN_BOW && ! !launcher->cursed && !rn2(3)) ! multishot++; /* 1/3 of object enchantment */ ! if (launcher && launcher->spe > 1) ! multishot += (long) rounddiv(launcher->spe,3); /* ...or is using a special weapon for their role... */ switch (Role_switch) { *************** *** 151,163 **** /* Rate of fire is intrinsic to the weapon - cannot be user selected * except via altmode */ ! if (objects[(launcher->otyp)].oc_rof) ! multishot += (objects[(launcher->otyp)].oc_rof - 1); ! if (launcher->altmode == WP_MODE_SINGLE) /* weapons switchable b/w full/semi auto */ ! multishot = 1; ! else if (launcher->altmode == WP_MODE_BURST) ! multishot = ((multishot > 3) ? (multishot / 3) : 1); ! /* else it is auto == no change */ #endif } --- 154,170 ---- /* Rate of fire is intrinsic to the weapon - cannot be user selected * except via altmode */ ! if (launcher) ! { ! if (objects[(launcher->otyp)].oc_rof) ! multishot += (objects[(launcher->otyp)].oc_rof - 1); ! if (launcher->altmode == WP_MODE_SINGLE) ! /* weapons switchable b/w full/semi auto */ ! multishot = 1; ! else if (launcher->altmode == WP_MODE_BURST) ! multishot = ((multishot > 3) ? (multishot / 3) : 1); ! /* else it is auto == no change */ ! } #endif }