I tried to add a check in do_wield so barbarians only can use bludgeon weapons. Compiles just fine, but crashed game when trying to wield a weapon. Ideas why ?
Code:
ACMD(do_wield)
{
char arg[MAX_INPUT_LENGTH];
struct obj_data *obj;
one_argument(argument, arg);
if (!*arg)
send_to_char(ch, "Wield what?\r\n");
else if (!(obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))
send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg);
else {
if (!CAN_WEAR(obj, ITEM_WEAR_WIELD))
send_to_char(ch, "You can't wield that.\r\n");
else if (GET_OBJ_WEIGHT(obj) > str_app[STRENGTH_APPLY_INDEX(ch)].wield_w)
send_to_char(ch, "It's too heavy for you to use.\r\n");
else if (GET_LEVEL(ch) < GET_OBJ_LEVEL(obj))
send_to_char(ch, "You are not experienced enough to use that.\r\n");
else if ((GET_CLASS(ch) == CLASS_BARBARIAN) && (GET_OBJ_VAL(GET_EQ(ch, WEAR_WIELD), 3) != TYPE_BLUDGEON - TYPE_HIT))
send_to_char(ch, "Barbarians can only wield bludgeon weapons.\r\n");
else
perform_wear(ch, obj, WEAR_WIELD);
}
}