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

Comparing deliantra/server/server/shop.C (file contents):
Revision 1.19 by pippijn, Mon Dec 11 14:28:13 2006 UTC vs.
Revision 1.23 by root, Thu Dec 14 22:45:41 2006 UTC

590 { 590 {
591 // This should not happen, but if it does, just merge the two. 591 // This should not happen, but if it does, just merge the two.
592 if (coin_objs [i]) 592 if (coin_objs [i])
593 { 593 {
594 LOG (llevError, "%s has two money entries of (%s)\n", &pouch->name, coins[NUM_COINS - 1 - i]); 594 LOG (llevError, "%s has two money entries of (%s)\n", &pouch->name, coins[NUM_COINS - 1 - i]);
595 remove_ob (tmp); 595 tmp->remove ();
596 coin_objs[i]->nrof += tmp->nrof; 596 coin_objs[i]->nrof += tmp->nrof;
597 esrv_del_item (pl->contr, tmp->count); 597 esrv_del_item (pl->contr, tmp->count);
598 free_object (tmp); 598 tmp->destroy ();
599 } 599 }
600 else 600 else
601 { 601 {
602 remove_ob (tmp); 602 tmp->remove ();
603 603
604 if (pouch->type == PLAYER) 604 if (pouch->type == PLAYER)
605 esrv_del_item (pl->contr, tmp->count); 605 esrv_del_item (pl->contr, tmp->count);
606 606
607 coin_objs[i] = tmp; 607 coin_objs[i] = tmp;
666 666
667 if (pl->type != PLAYER) 667 if (pl->type != PLAYER)
668 esrv_send_item (pl, pl); 668 esrv_send_item (pl, pl);
669 } 669 }
670 else 670 else
671 free_object (coin_objs[i]); 671 coin_objs[i]->destroy ();
672 } 672 }
673} 673}
674 674
675/* Checks all unpaid items in op's inventory, adds up all the money they 675/* Checks all unpaid items in op's inventory, adds up all the money they
676 * have, and checks that they can actually afford what they want to buy. 676 * have, and checks that they can actually afford what they want to buy.
838 } 838 }
839 } 839 }
840 } 840 }
841 841
842 if (amount != 0) 842 if (amount != 0)
843#ifndef WIN32
844 LOG (llevError, "Warning - payment in pay_player () not zero: %llu\n", amount); 843 LOG (llevError, "Warning - payment in pay_player () not zero: %llu\n", amount);
845#else
846 LOG (llevError, "Warning - payment in pay_player () not zero: %I64u\n", amount);
847#endif
848} 844}
849 845
850/* elmex: this is for the bank plugin :( */ 846/* elmex: this is for the bank plugin :( */
851sint64 847sint64
852pay_player_arch (object *pl, const char *arch, sint64 amount) 848pay_player_arch (object *pl, const char *arch, sint64 amount)
1182 case RING: 1178 case RING:
1183 case AMULET: 1179 case AMULET:
1184 case BRACERS: 1180 case BRACERS:
1185 case GIRDLE: 1181 case GIRDLE:
1186 sprintf (buf, "%s %s", query_base_name (tmp, 0), describe_item (tmp, NULL)); 1182 sprintf (buf, "%s %s", query_base_name (tmp, 0), describe_item (tmp, NULL));
1187 items[*numitems].item_sort = strdup_local (buf); 1183 items[*numitems].item_sort = strdup (buf);
1188 sprintf (buf, "%s %s", query_name (tmp), describe_item (tmp, NULL)); 1184 sprintf (buf, "%s %s", query_name (tmp), describe_item (tmp, NULL));
1189 items[*numitems].item_real = strdup_local (buf); 1185 items[*numitems].item_real = strdup (buf);
1190 (*numitems)++; 1186 (*numitems)++;
1191 break; 1187 break;
1192#endif 1188#endif
1193 1189
1194 default: 1190 default:
1195 items[*numitems].item_sort = strdup_local (query_base_name (tmp, 0)); 1191 items[*numitems].item_sort = strdup (query_base_name (tmp, 0));
1196 items[*numitems].item_real = strdup_local (query_base_name (tmp, 1)); 1192 items[*numitems].item_real = strdup (query_base_name (tmp, 1));
1197 (*numitems)++; 1193 (*numitems)++;
1198 break; 1194 break;
1199 } 1195 }
1200 SET_FLAG (tmp, FLAG_UNPAID); 1196 SET_FLAG (tmp, FLAG_UNPAID);
1201} 1197}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines