--- deliantra/server/common/object.C 2008/04/21 06:35:26 1.209 +++ deliantra/server/common/object.C 2008/04/21 07:01:40 1.210 @@ -1552,11 +1552,10 @@ } /* - * get_split_ob(ob,nr) splits up ob into two parts. The part which + * split(ob,nr) splits up ob into two parts. The part which * is returned contains nr objects, and the remaining parts contains - * the rest (or is removed and freed if that number is 0). - * On failure, NULL is returned, and the reason put into the - * global static errmsg array. + * the rest (or is removed and returned if that number is 0). + * On failure, NULL is returned. */ object * object::split (sint32 nr) @@ -1578,19 +1577,6 @@ } } -//TODO: remove, but semantics differs from split_nr -object * -get_split_ob (object *orig_ob, uint32 nr) -{ - if (orig_ob->nrof < nr) - { - sprintf (errmsg, "There are only %d %ss.", orig_ob->nrof ? orig_ob->nrof : 1, &orig_ob->name); - return 0; - } - - return orig_ob->split (nr); -} - object * insert_ob_in_ob (object *op, object *where) { @@ -1639,6 +1625,8 @@ /* return the original object and remove inserted object (client needs the original object) */ tmp->nrof += op->nrof; + adjust_weight (this, op->total_weight ()); + op->destroy (1); op = tmp; goto inserted;