So right after I posted that, I found one little bug: shops also checked to see if you could carry an item before selling it to you! So, I found that every time it made a reference to IS_CARRYING_W(ch), you replaced it with check_encumbrance(ch, SIT_INV_WNUMBER); compiles just fine but still working on other things before testing.
Also, it was mentioned that items with no weight in one mud being very powerful. Now, such items can be created by adding the flag ITEM_NOWEIGHT in the same #define list as ARM_HEAVY, ARM_LIGHT, etc. In check_encumbrance I added another condition it checks for when counting the weight of your worn gear. Here's a line to show an example. Well, a few lines.
Code:
if (GET_EQ(ch, WEAR_LIGHT) && !OBJ_FLAGGED(GET_EQ(ch, WEAR_LIGHT), ITEM_NOWEIGHT)) current += GET_OBJ_WEIGHT(GET_EQ(ch, WEAR_LIGHT));
if (GET_EQ(ch, WEAR_FINGER_R) && !OBJ_FLAGGED(GET_EQ(ch, WEAR_FINGER_R), ITEM_NOWEIGHT)) current += GET_OBJ_WEIGHT(GET_EQ(ch, WEAR_FINGER_R));
if (GET_EQ(ch, WEAR_FINGER_L) && !OBJ_FLAGGED(GET_EQ(ch, WEAR_FINGER_L), ITEM_NOWEIGHT)) current += GET_OBJ_WEIGHT(GET_EQ(ch, WEAR_FINGER_L));
if (GET_EQ(ch, WEAR_NECK_1) && !OBJ_FLAGGED(GET_EQ(ch, WEAR_NECK_1), ITEM_NOWEIGHT)) current += GET_OBJ_WEIGHT(GET_EQ(ch, WEAR_NECK_1));
if (GET_EQ(ch, WEAR_NECK_2) && !OBJ_FLAGGED(GET_EQ(ch, WEAR_NECK_2), ITEM_NOWEIGHT)) current += GET_OBJ_WEIGHT(GET_EQ(ch, WEAR_NECK_2));
if (GET_EQ(ch, WEAR_BODY) && !OBJ_FLAGGED(GET_EQ(ch, WEAR_BODY), ITEM_NOWEIGHT)) current += GET_OBJ_WEIGHT(GET_EQ(ch, WEAR_BODY));
Not that this is all of the wear positions, but you get the idea.
What about items laying about in your inventory? The code adds and subtracts weight from IS_CARRYING_W when items are picked up and dropped/given away in handler.c. So, made the following small changes, which compile fine but still haven't tested yet.
In obj_to_char function...
Code:
ch->carrying = object;
object->carried_by = ch;
IN_ROOM(object) = NOWHERE;
if (!OBJ_FLAGGED(object, ITEM_NOWEIGHT)) IS_CARRYING_W(ch) += GET_OBJ_WEIGHT(object); // <--- Changed by adding that if statement to the front.
IS_CARRYING_N(ch)++;
And obj_from_char function...
Code:
if (!IS_NPC(object->carried_by))
SET_BIT_AR(PLR_FLAGS(object->carried_by), PLR_CRASH);
if (!OBJ_FLAGGED(object, ITEM_NOWEIGHT)) IS_CARRYING_W(object->carried_by) -= GET_OBJ_WEIGHT(object); // <---- Same thing. New if statement.
IS_CARRYING_N(object->carried_by)--;
object->carried_by = NULL;
I'm still working on some other stuff but when I finish with that I'll undoubtedly test all of this out and fix any OTHER mistakes I have made. Durp.
Edit:
You know, like forgetting that weight check when pick-pocketing an item? Did this small change to fix.
Code:
if (check_encumbrance(ch, SIT_INV_WNUMBER) + GET_OBJ_WEIGHT(obj) < CAN_CARRY_W(ch)) { // changed IS_CARRYING_W(ch) with check_encumbrance
that was found in do_steal in act.other.c.