ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/object.C
(Generate patch)

Comparing deliantra/server/common/object.C (file contents):
Revision 1.356 by root, Mon Nov 12 03:48:34 2012 UTC vs.
Revision 1.359 by root, Wed Dec 12 02:13:04 2012 UTC

351 /* inventory ok - still need to check rest of this object to see 351 /* inventory ok - still need to check rest of this object to see
352 * if it is valid. 352 * if it is valid.
353 */ 353 */
354 } 354 }
355 355
356 /* Don't merge objects that are applied. With the new 'body' code, 356 /* Don't merge objects that are applied. With the new 'body' code,
357 * it is possible for most any character to have more than one of 357 * it is possible for most any character to have more than one of
358 * some items equipped, and we don't want those to merge. 358 * some items equipped, and we don't want those to merge.
359 */ 359 */
360 if (ob1->flag [FLAG_APPLIED] || ob2->flag [FLAG_APPLIED]) 360 if (ob1->flag [FLAG_APPLIED] || ob2->flag [FLAG_APPLIED])
361 return 0; 361 return 0;
362 362
363 /* Note sure why the following is the case - either the object has to 363 /* Not sure why the following is the case - either the object has to
364 * be animated or have a very low speed. Is this an attempted monster 364 * be animated or have a very low speed. Is this an attempted monster
365 * check? 365 * check?
366 */ 366 */
367 if (!ob1->flag [FLAG_ANIMATE] && ob1->has_active_speed ()) 367 if (!ob1->flag [FLAG_ANIMATE] && ob1->has_active_speed ())
368 return 0; 368 return 0;
369 369
464static void 464static void
465adjust_weight (object *op, weight_t sub, weight_t add) 465adjust_weight (object *op, weight_t sub, weight_t add)
466{ 466{
467 while (op) 467 while (op)
468 { 468 {
469 weight_t carrying = op->carrying 469 weight_t carrying = (weight_t)op->carrying
470 - weight_adjust_for (op, sub); 470 - weight_adjust_for (op, sub)
471 + weight_adjust_for (op, add); 471 + weight_adjust_for (op, add);
472 472
473 sub = op->carrying; 473 sub = op->carrying;
474 op->carrying = carrying; 474 op->carrying = carrying;
475 add = op->carrying; 475 add = op->carrying;
636 speed_left = -1.; 636 speed_left = -1.;
637 637
638 /* copy the body_info to the body_used - this is only really 638 /* copy the body_info to the body_used - this is only really
639 * need for monsters, but doesn't hurt to do it for everything. 639 * need for monsters, but doesn't hurt to do it for everything.
640 * by doing so, when a monster is created, it has good starting 640 * by doing so, when a monster is created, it has good starting
641 * values for the body_used info, so when items are created 641 * values for the body_used info, so when items are created
642 * for it, they can be properly equipped. 642 * for it, they can be properly equipped.
643 */ 643 */
644 for (int i = NUM_BODY_LOCATIONS; i--; ) 644 for (int i = NUM_BODY_LOCATIONS; i--; )
645 slot[i].used = slot[i].info; 645 slot[i].used = slot[i].info;
646 646

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines