- Posts: 937
- Thank you received: 17
Please Log in or Create an account to join the conversation.
JTP wrote: Those two sets of changes gives:
act.item.c: In function ‘perform_wear’:
act.item.c:1312: error: too few arguments to function ‘free_hands’
make[1]: *** [act.item.o] Error 1
Line 1312:
int hands = free_hands(ch);
Code used for above:Code:static int free_hands(struct char_data *ch, struct obj_data *obj); static int free_hands(struct char_data *ch, struct obj_data *obj) { 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_WIELD)) { if (GET_EQ(ch, WEAR_WIELD) || OBJ_FLAGGED(obj, ITEM_TWO_HANDED)) { used -= 2; } else { used -= 1; } } return used; } /* And in: static void perform_wear(struct char_data *ch, struct obj_data *obj, int where) */ if (where == WEAR_WIELD || where == WEAR_SHIELD || where == WEAR_LIGHT || where == WEAR_HOLD) { int hands = free_hands(ch); if (hands < 1 && !OBJ_FLAGGED(obj, ITEM_TWO_HANDED)) { send_to_char(ch, "Your hands are full!\r\n"); return; } if (hands < 2 && OBJ_FLAGGED(obj, ITEM_TWO_HANDED)) { send_to_char(ch, "Your hands are full!\r\n"); return; } }
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
JTP wrote: Ok I got it compiling and almost working..
If I Wear shield/light/hold first, and then try to wield the two-handed, then I cant do it, this works as it should.
BUT if I wield the two-handed first, and then Wear shield/light/hold, then I can do that, but should not be able to.
So why is that, any idea ?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
tbaMUD © 2024