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

Comparing deliantra/server/server/c_object.C (file contents):
Revision 1.99 by sf-marcmagus, Fri Oct 16 16:29:47 2009 UTC vs.
Revision 1.100 by root, Mon Oct 19 21:48:49 2009 UTC

362 count = tmp->nrof; 362 count = tmp->nrof;
363 363
364 /* container is open, so use it */ 364 /* container is open, so use it */
365 if (tmp->flag [FLAG_STARTEQUIP]) 365 if (tmp->flag [FLAG_STARTEQUIP])
366 alt = op; 366 alt = op;
367 else if (op->container) 367 else if ((alt = op->container_ ()))
368 { 368 {
369 alt = op->container;
370 if (alt != tmp->env && !sack_can_hold (op, alt, tmp, count)) 369 if (alt != tmp->env && !sack_can_hold (op, alt, tmp, count))
371 goto leave; 370 goto leave;
372 } 371 }
373 else 372 else
374 { /* non container pickup */ 373 { /* non container pickup */
428int 427int
429command_take (object *op, char *params) 428command_take (object *op, char *params)
430{ 429{
431 object *tmp, *next; 430 object *tmp, *next;
432 431
433 if (op->container) 432 if (op->container_ ())
434 tmp = op->container->inv; 433 tmp = op->container_ ()->inv;
435 else 434 else
436 { 435 {
437 tmp = op->above; 436 tmp = op->above;
438 if (tmp) 437 if (tmp)
439 while (tmp->above) 438 while (tmp->above)
540 539
541 for (tmp2 = tmp->inv; tmp2; tmp2 = tmp) 540 for (tmp2 = tmp->inv; tmp2; tmp2 = tmp)
542 { 541 {
543 tmp = tmp2->below; 542 tmp = tmp2->below;
544 543
545 if ((sack->type == CONTAINER && sack_can_hold (op, op->container, tmp2, tmp2->nrof))) 544 if ((sack->type == CONTAINER && sack_can_hold (op, op->container_ (), tmp2, tmp2->nrof)))
546 put_object_in_sack (op, sack, tmp2, 0); 545 put_object_in_sack (op, sack, tmp2, 0);
547 else 546 else
548 { 547 {
549 sprintf (buf, "Your %s fills up.", query_name (sack)); 548 sprintf (buf, "Your %s fills up.", query_name (sack));
550 new_draw_info (NDI_UNIQUE, 0, op, buf); 549 new_draw_info (NDI_UNIQUE, 0, op, buf);
706 if (op->type == PLAYER && op->contr->last_used == tmp) 705 if (op->type == PLAYER && op->contr->last_used == tmp)
707 op->contr->last_used = tmp->below ? tmp->below 706 op->contr->last_used = tmp->below ? tmp->below
708 : tmp->above ? tmp->above 707 : tmp->above ? tmp->above
709 : (object *)0; 708 : (object *)0;
710 709
711 if (op->container) 710 if (op->container_ ())
712 { 711 {
713 if (op->type == PLAYER) 712 if (op->type == PLAYER)
714 put_object_in_sack (op, op->container, tmp, op->contr->count); 713 put_object_in_sack (op, op->container_ (), tmp, op->contr->count);
715 else 714 else
716 put_object_in_sack (op, op->container, tmp, 0); 715 put_object_in_sack (op, op->container_ (), tmp, 0);
717 } 716 }
718 else 717 else
719 { 718 {
720 if (op->type == PLAYER) 719 if (op->type == PLAYER)
721 drop_object (op, tmp, op->contr->count); 720 drop_object (op, tmp, op->contr->count);
763 nextinv = nextinv->below; 762 nextinv = nextinv->below;
764 763
765 if (!QUERY_FLAG (curinv, FLAG_INV_LOCKED) && curinv->type != MONEY && 764 if (!QUERY_FLAG (curinv, FLAG_INV_LOCKED) && curinv->type != MONEY &&
766 curinv->type != FOOD && curinv->type != KEY && 765 curinv->type != FOOD && curinv->type != KEY &&
767 curinv->type != SPECIAL_KEY && curinv->type != GEM && 766 curinv->type != SPECIAL_KEY && curinv->type != GEM &&
768 !curinv->invisible && (curinv->type != CONTAINER || op->container != curinv)) 767 !curinv->invisible && (curinv->type != CONTAINER || op->container_ () != curinv))
769 { 768 {
770 drop (op, curinv); 769 drop (op, curinv);
771 if (--cnt <= 0) break; 770 if (--cnt <= 0) break;
772 } 771 }
773 772

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines