Code:
Open act.item.c.
Before the perform_put() function add:
int free_hands(struct char_data *ch) {
int used = 2;
if(GET_EQ(ch, WEAR_HOLD)) { used -= 1; }
if(GET_EQ(ch, WEAR_LIGHT)) { used -= 1; }
if(GET_EQ(ch, WEAR_SHIELD)) { used -= 1; }
if(GET_EQ(ch, WEAR_OFFHAND)) { used -= 1; }
if(GET_EQ(ch, WEAR_WIELD)) {
if(IS_OBJ_STAT(GET_EQ(ch, WEAR_WIELD), ITEM_TWO_HANDED)) {
used -= 2;
}
else { used -= 1; }
}
return used;
}
Further down in act.item.c in the:
void perform_wear(struct char_data * ch, struct obj_data * obj, int where) {
function, look for this:
if (GET_EQ(ch, where)) {
send_to_char(already_wearing[where], ch);
return;
}
Directly below that chunk of code add:
if(where == WEAR_WIELD || where == WEAR_SHIELD || where == WEAR_LIGHT || where == WEAR_HOLD) {
if(free_hands(ch) < 1 && !IS_OBJ_STAT(obj, ITEM_TWO_HANDED)) {
send_to_char("You hands are full!\r\n", ch);
return;
}
if(free_hands(ch) < 2 && IS_OBJ_STAT(obj, ITEM_TWO_HANDED)) {
send_to_char("Your hands are full!\r\n", ch);
return;
}
}
Save the file and exit.