/*
* Move an object into an object.
*/
void obj_to_obj (OBJ_DATA * obj, OBJ_DATA * obj_to)
{
obj->next_content = obj_to->contains;
obj_to->contains = obj;
obj->in_obj = obj_to;
obj->in_room = NULL;
obj->carried_by = NULL;
if (obj_to->pIndexData->vnum == OBJ_VNUM_PIT)
obj->cost = 0;
for (; obj_to != NULL; obj_to = obj_to->in_obj)
{
if (obj_to->carried_by != NULL)
{
obj_to->carried_by->carry_number += get_obj_number (obj);
obj_to->carried_by->carry_weight += get_obj_weight (obj) * WEIGHT_MULT (obj_to) / 100;
/***Thanks to Zeno for the code change.***/
if(obj_to->item_type == ITEM_CONTAINER)
{
obj_to->carried_by -= get_obj_number (obj);
}
}
}
return;
}
/*
* Move an object into an object.
*/
void obj_to_obj (OBJ_DATA * obj, OBJ_DATA * obj_to)
{
…
if (obj_to->carried_by != NULL)
{
if (obj_to->item_type!=ITEM_CONTAINER)
obj_to->carried_by->carry_number += get_obj_number (obj);
obj_to->carried_by->carry_weight += get_obj_weight (obj) * WEIGHT_MULT (obj_to) / 100;
}
…
}
That was attempted in handler.c and the only place I found where items are deducted from the player so I gave it a shot there. If anyone knows how to make it so items don't count towards the player once in a container, or could point me towards the correct file to modify it'd be appreciated.
–Silence Tyire of Reanimation
Edit by kiasyn to add code tags