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

Comparing deliantra/server/server/apply.C (file contents):
Revision 1.169 by root, Sun Sep 7 21:31:23 2008 UTC vs.
Revision 1.173 by elmex, Sun Oct 5 14:22:25 2008 UTC

995 item->nrof = give; 995 item->nrof = give;
996 996
997 if (nr) 997 if (nr)
998 item->nrof *= nr; 998 item->nrof *= nr;
999 999
1000 if (is_in_shop (converter)) 1000 if (converter->flag [FLAG_PRECIOUS])
1001 SET_FLAG (item, FLAG_UNPAID); 1001 SET_FLAG (item, FLAG_UNPAID);
1002
1003 if (is_in_shop (converter))
1004 {
1005 // converters on shop floors don't work anymore, bug lets check for it
1006 // and report in case someone still does it.
1007 LOG (llevDebug, "ITEMBUG: broken converter, converters on shop floor don't work: %s\n",
1008 converter->debug_desc ());
1009 SET_FLAG (item, FLAG_UNPAID);
1010 }
1002 else if (price_in < sint64 (item->nrof) * item->value) 1011 else if (price_in < sint64 (item->nrof) * item->value)
1003 { 1012 {
1004 LOG (llevDebug, "converter output price higher than input: %s at %s (%d, %d) in value %d, out value %d for %s\n", 1013 LOG (llevDebug, "converter output price higher than input: %s at %s (%d, %d) in value %d, out value %d for %s\n",
1005 &converter->name, &converter->map->path, converter->x, converter->y, price_in, item->nrof * item->value, &item->name); 1014 &converter->name, &converter->map->path, converter->x, converter->y, price_in, item->nrof * item->value, &item->name);
1006 /** 1015 /**
1306 ns->play_sound (sign->sound); 1315 ns->play_sound (sign->sound);
1307 else if (autoapply) 1316 else if (autoapply)
1308 ns->play_sound (sound_find ("msg_voice")); 1317 ns->play_sound (sound_find ("msg_voice"));
1309 1318
1310 if (ns->can_msg) 1319 if (ns->can_msg)
1311 op->contr->infobox (MSG_CHANNEL ("examine"), format ("T<%s>\n\n\n\n%s", &sign->name, &sign->msg)); 1320 op->contr->infobox (MSG_CHANNEL ("examine"), format ("T<%s>\n\n%s", &sign->name, &sign->msg));
1312 else 1321 else
1313 { 1322 {
1314 readable_message_type *msgType = get_readable_message_type (sign); 1323 readable_message_type *msgType = get_readable_message_type (sign);
1315 const char *somemsg = format ("%u %s", autoapply ? 1 : 0, &sign->msg); 1324 const char *somemsg = format ("%u %s", autoapply ? 1 : 0, &sign->msg);
1316 draw_ext_info (NDI_UNIQUE | NDI_NAVY, 0, op, msgType->message_type, msgType->message_subtype, somemsg, &sign->msg); 1325 draw_ext_info (NDI_UNIQUE | NDI_NAVY, 0, op, msgType->message_type, msgType->message_subtype, somemsg, &sign->msg);
1627 readable_message_type *msgType = get_readable_message_type (tmp); 1636 readable_message_type *msgType = get_readable_message_type (tmp);
1628 1637
1629 if (player *pl = op->contr) 1638 if (player *pl = op->contr)
1630 if (client *ns = pl->ns) 1639 if (client *ns = pl->ns)
1631 if (ns->can_msg) 1640 if (ns->can_msg)
1632 pl->infobox (MSG_CHANNEL ("book"), format ("T<%s>\n\n\n\n%s", (char *)long_desc (tmp, op), &tmp->msg)); 1641 pl->infobox (MSG_CHANNEL ("book"), format ("T<%s>\n\n%s", (char *)long_desc (tmp, op), &tmp->msg));
1633 else 1642 else
1634 draw_ext_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, 1643 draw_ext_info_format (NDI_UNIQUE | NDI_NAVY, 0, op,
1635 msgType->message_type, msgType->message_subtype, 1644 msgType->message_type, msgType->message_subtype,
1636 "You open the %s and start reading.\n%s", (char *)"%s\n%s", 1645 "You open the %s and start reading.\n%s", (char *)"%s\n%s",
1637 long_desc (tmp, op), &tmp->msg); 1646 long_desc (tmp, op), &tmp->msg);
1965 if (op->destroyed () || tmp->destroyed ()) 1974 if (op->destroyed () || tmp->destroyed ())
1966 break; 1975 break;
1967 } 1976 }
1968 1977
1969 if (!tmp->destroyed () && !tmp->inv) 1978 if (!tmp->destroyed () && !tmp->inv)
1970 tmp->decrease (); 1979 tmp->decrease (true);
1971} 1980}
1972 1981
1973/** 1982/**
1974 * op eats food. 1983 * op eats food.
1975 * If player, takes care of messages and dragon special food. 1984 * If player, takes care of messages and dragon special food.
3572 /* If we generated an object and put it in this object inventory, 3581 /* If we generated an object and put it in this object inventory,
3573 * move it to the parent object as the current object is about 3582 * move it to the parent object as the current object is about
3574 * to disappear. An example of this item is the random_* stuff 3583 * to disappear. An example of this item is the random_* stuff
3575 * that is put inside other objects. 3584 * that is put inside other objects.
3576 */ 3585 */
3577 for (tmp = op->inv; tmp; tmp = tmp2)
3578 {
3579 tmp2 = tmp->below;
3580 tmp->remove ();
3581
3582 if (op->env) 3586 if (op->env)
3583 insert_ob_in_ob (tmp, op->env); 3587 while (op->inv)
3584 else 3588 op->env->insert (op->inv);
3585 tmp->destroy ();
3586 }
3587 3589
3588 op->destroy (); 3590 op->destroy ();
3589 break; 3591 break;
3590 } 3592 }
3591 3593

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines