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.21 by root, Sun Oct 15 02:16:35 2006 UTC vs.
Revision 1.25 by root, Tue Dec 12 21:39:57 2006 UTC

276 new_draw_info (NDI_UNIQUE, 0, pl, "It must have been an illusion."); 276 new_draw_info (NDI_UNIQUE, 0, pl, "It must have been an illusion.");
277 277
278 if (pl->type == PLAYER) 278 if (pl->type == PLAYER)
279 esrv_del_item (pl->contr, tmp->count); 279 esrv_del_item (pl->contr, tmp->count);
280 280
281 if (!QUERY_FLAG (tmp, FLAG_REMOVED)) 281 tmp->destroy ();
282 remove_ob (tmp);
283
284 free_object (tmp);
285 return; 282 return;
286 } 283 }
287 284
288 if (nrof > tmp_nrof || nrof == 0) 285 if (nrof > tmp_nrof || nrof == 0)
289 nrof = tmp_nrof; 286 nrof = tmp_nrof;
335 */ 332 */
336 if (!QUERY_FLAG (tmp, FLAG_REMOVED)) 333 if (!QUERY_FLAG (tmp, FLAG_REMOVED))
337 { 334 {
338 if (tmp->env && pl->type == PLAYER) 335 if (tmp->env && pl->type == PLAYER)
339 esrv_del_item (pl->contr, tmp->count); 336 esrv_del_item (pl->contr, tmp->count);
340 remove_ob (tmp); /* Unlink it */ 337 tmp->remove (); /* Unlink it */
341 } 338 }
342 } 339 }
343 if (QUERY_FLAG (tmp, FLAG_UNPAID)) 340 if (QUERY_FLAG (tmp, FLAG_UNPAID))
344 (void) sprintf (buf, "%s will cost you %s.", query_name (tmp), query_cost_string (tmp, pl, F_BUY | F_SHOP)); 341 (void) sprintf (buf, "%s will cost you %s.", query_name (tmp), query_cost_string (tmp, pl, F_BUY | F_SHOP));
345 else 342 else
632 esrv_del_item (op->contr, tmp2->count); 629 esrv_del_item (op->contr, tmp2->count);
633 else /* this can proably be replaced with an update */ 630 else /* this can proably be replaced with an update */
634 esrv_send_item (op, tmp2); 631 esrv_send_item (op, tmp2);
635 } 632 }
636 else 633 else
637 remove_ob (tmp); 634 tmp->remove ();
638 635
639 new_draw_info_format (NDI_UNIQUE, 0, op, "You put the %s in %s.", query_name (tmp), query_name (sack)); 636 new_draw_info_format (NDI_UNIQUE, 0, op, "You put the %s in %s.", query_name (tmp), query_name (sack));
640 tmp2 = insert_ob_in_ob (tmp, sack); 637 tmp2 = insert_ob_in_ob (tmp, sack);
641 fix_player (op); /* This is overkill, fix_player() is called somewhere */ 638 fix_player (op); /* This is overkill, fix_player() is called somewhere */
642 /* in object.c */ 639 /* in object.c */
670 667
671 if (QUERY_FLAG (tmp, FLAG_APPLIED)) 668 if (QUERY_FLAG (tmp, FLAG_APPLIED))
672 if (apply_special (op, tmp, AP_UNAPPLY | AP_NO_MERGE)) 669 if (apply_special (op, tmp, AP_UNAPPLY | AP_NO_MERGE))
673 return; /* can't unapply it */ 670 return; /* can't unapply it */
674 671
675 /* We are only dropping some of the items. We split the current objec 672 /* We are only dropping some of the items. We split the current object
676 * off 673 * off
677 */ 674 */
678 if (nrof && tmp->nrof != nrof) 675 if (nrof && tmp->nrof != nrof)
679 { 676 {
680 object *tmp2 = tmp; 677 object *tmp2 = tmp;
695 else 692 else
696 esrv_send_item (op, tmp2); 693 esrv_send_item (op, tmp2);
697 } 694 }
698 } 695 }
699 else 696 else
700 remove_ob (tmp); 697 tmp->remove ();
701 698
702 if (INVOKE_OBJECT (DROP, tmp, ARG_OBJECT (op))) 699 if (INVOKE_OBJECT (DROP, tmp, ARG_OBJECT (op)))
703 return; 700 return;
704 701
705 if (QUERY_FLAG (tmp, FLAG_STARTEQUIP)) 702 if (QUERY_FLAG (tmp, FLAG_STARTEQUIP))
707 sprintf (buf, "You drop the %s.", query_name (tmp)); 704 sprintf (buf, "You drop the %s.", query_name (tmp));
708 new_draw_info (NDI_UNIQUE, 0, op, buf); 705 new_draw_info (NDI_UNIQUE, 0, op, buf);
709 new_draw_info (NDI_UNIQUE, 0, op, "The gods who lent it to you retrieves it."); 706 new_draw_info (NDI_UNIQUE, 0, op, "The gods who lent it to you retrieves it.");
710 if (op->type == PLAYER) 707 if (op->type == PLAYER)
711 esrv_del_item (op->contr, tmp->count); 708 esrv_del_item (op->contr, tmp->count);
712 free_object (tmp); 709 tmp->destroy ();
713 fix_player (op); 710 fix_player (op);
714 return; 711 return;
715 } 712 }
716 713
717/* If SAVE_INTERVAL is commented out, we never want to save 714/* If SAVE_INTERVAL is commented out, we never want to save
773 if (tmp->env && tmp->env->type != PLAYER) 770 if (tmp->env && tmp->env->type != PLAYER)
774 { 771 {
775 /* Just toss the object - probably shouldn't be hanging 772 /* Just toss the object - probably shouldn't be hanging
776 * around anyways 773 * around anyways
777 */ 774 */
778 remove_ob (tmp); 775 tmp->remove ();
779 free_object (tmp); 776 tmp->destroy ();
780 return; 777 return;
781 } 778 }
782 else 779 else
783 { 780 {
784 while (tmp != NULL && tmp->invisible) 781 while (tmp != NULL && tmp->invisible)
1455 new_draw_info_format (NDI_UNIQUE, 0, op, "%d MAGICDEVICE", i & PU_MAGIC_DEVICE ? 1 : 0); 1452 new_draw_info_format (NDI_UNIQUE, 0, op, "%d MAGICDEVICE", i & PU_MAGIC_DEVICE ? 1 : 0);
1456 1453
1457 new_draw_info_format (NDI_UNIQUE, 0, op, "%d NOT CURSED", i & PU_NOT_CURSED ? 1 : 0); 1454 new_draw_info_format (NDI_UNIQUE, 0, op, "%d NOT CURSED", i & PU_NOT_CURSED ? 1 : 0);
1458 1455
1459 new_draw_info_format (NDI_UNIQUE, 0, op, "%d JEWELS", i & PU_JEWELS ? 1 : 0); 1456 new_draw_info_format (NDI_UNIQUE, 0, op, "%d JEWELS", i & PU_JEWELS ? 1 : 0);
1457 new_draw_info_format (NDI_UNIQUE, 0, op, "%d FLESH", i & PU_FLESH ? 1 : 0);
1460 1458
1461 new_draw_info_format (NDI_UNIQUE, 0, op, ""); 1459 new_draw_info_format (NDI_UNIQUE, 0, op, "");
1462} 1460}
1463 1461
1464int 1462int
1466{ 1464{
1467 uint32 i; 1465 uint32 i;
1468 static const char *names[] = { 1466 static const char *names[] = {
1469 "debug", "inhibit", "stop", "food", "drink", "valuables", "bow", "arrow", "helmet", 1467 "debug", "inhibit", "stop", "food", "drink", "valuables", "bow", "arrow", "helmet",
1470 "shield", "armour", "boots", "gloves", "cloak", "key", "missile", "allweapon", 1468 "shield", "armour", "boots", "gloves", "cloak", "key", "missile", "allweapon",
1471 "magical", "potion", "spellbook", "skillscroll", "readables", "magicdevice", "notcursed", "jewels", NULL 1469 "magical", "potion", "spellbook", "skillscroll", "readables", "magicdevice", "notcursed",
1470 "jewels", "flesh", NULL
1472 }; 1471 };
1473 static uint32 modes[] = { 1472 static uint32 modes[] = {
1474 PU_DEBUG, PU_INHIBIT, PU_STOP, PU_FOOD, PU_DRINK, PU_VALUABLES, PU_BOW, PU_ARROW, PU_HELMET, 1473 PU_DEBUG, PU_INHIBIT, PU_STOP, PU_FOOD, PU_DRINK, PU_VALUABLES, PU_BOW, PU_ARROW, PU_HELMET,
1475 PU_SHIELD, PU_ARMOUR, PU_BOOTS, PU_GLOVES, PU_CLOAK, PU_KEY, PU_MISSILEWEAPON, PU_ALLWEAPON, 1474 PU_SHIELD, PU_ARMOUR, PU_BOOTS, PU_GLOVES, PU_CLOAK, PU_KEY, PU_MISSILEWEAPON, PU_ALLWEAPON,
1476 PU_MAGICAL, PU_POTION, PU_SPELLBOOK, PU_SKILLSCROLL, PU_READABLES, PU_MAGIC_DEVICE, PU_NOT_CURSED, PU_JEWELS, 0 1475 PU_MAGICAL, PU_POTION, PU_SPELLBOOK, PU_SKILLSCROLL, PU_READABLES, PU_MAGIC_DEVICE, PU_NOT_CURSED,
1476 PU_JEWELS, PU_FLESH, 0
1477 }; 1477 };
1478 1478
1479 if (!params) 1479 if (!params)
1480 { 1480 {
1481 /* if the new mode is used, just print the settings */ 1481 /* if the new mode is used, just print the settings */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines