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.46 by root, Wed Apr 9 14:36:47 2008 UTC vs.
Revision 1.48 by root, Tue Apr 22 02:46:18 2008 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify 8 * Deliantra is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
583 { 583 {
584 // This should not happen, but if it does, just merge the two. 584 // This should not happen, but if it does, just merge the two.
585 if (coin_objs [i]) 585 if (coin_objs [i])
586 { 586 {
587 LOG (llevError, "%s has two money entries of (%s)\n", &pouch->name, coins[NUM_COINS - 1 - i]); 587 LOG (llevError, "%s has two money entries of (%s)\n", &pouch->name, coins[NUM_COINS - 1 - i]);
588 tmp->remove ();
589 coin_objs[i]->nrof += tmp->nrof; 588 coin_objs[i]->nrof += tmp->nrof;
590 esrv_del_item (pl->contr, tmp->count);
591 tmp->destroy (); 589 tmp->destroy ();
592 } 590 }
593 else 591 else
594 { 592 {
595 tmp->remove (); 593 tmp->remove ();
596
597 if (pouch->type == PLAYER)
598 esrv_del_item (pl->contr, tmp->count);
599
600 coin_objs[i] = tmp; 594 coin_objs[i] = tmp;
601 } 595 }
602 596
603 break; 597 break;
604 } 598 }
839/* elmex: this is for the bank plugin :( */ 833/* elmex: this is for the bank plugin :( */
840sint64 834sint64
841pay_player_arch (object *pl, const char *arch, sint64 amount) 835pay_player_arch (object *pl, const char *arch, sint64 amount)
842{ 836{
843 archetype *at = archetype::find (arch); 837 archetype *at = archetype::find (arch);
844 object *tmp = NULL;
845 838
846 if (at == NULL) 839 if (!at)
847 return 0; 840 return 0;
848 841
849 if (amount > 0) 842 if (amount > 0)
850 { 843 {
851 tmp = arch_to_object (at); 844 object *tmp = arch_to_object (at);
852 tmp->nrof = amount; 845 tmp->nrof = amount;
853 tmp = insert_ob_in_ob (tmp, pl); 846 tmp = insert_ob_in_ob (tmp, pl);
854 esrv_send_item (pl, tmp); 847 esrv_send_item (pl, tmp);
855 esrv_send_item (pl, pl); 848 esrv_send_item (pl, pl);
856 } 849 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines