1 | |
1 | |
2 | /* |
2 | /* |
3 | * static char *rcsid_shop_c = |
3 | * static char *rcsid_shop_c = |
4 | * "$Id: shop.C,v 1.14 2006/09/12 19:20:08 root Exp $"; |
4 | * "$Id: shop.C,v 1.15 2006/09/14 21:16:13 root Exp $"; |
5 | */ |
5 | */ |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
9 | |
9 | |
… | |
… | |
334 | |
334 | |
335 | do |
335 | do |
336 | { |
336 | { |
337 | if (coins[*cointype] == NULL) |
337 | if (coins[*cointype] == NULL) |
338 | return NULL; |
338 | return NULL; |
339 | coin = find_archetype (coins[*cointype]); |
339 | coin = archetype::find (coins[*cointype]); |
340 | if (coin == NULL) |
340 | if (coin == NULL) |
341 | return NULL; |
341 | return NULL; |
342 | *cointype += 1; |
342 | *cointype += 1; |
343 | } |
343 | } |
344 | while (coin->clone.value > c); |
344 | while (coin->clone.value > c); |
… | |
… | |
625 | /* Fill in any gaps in the coin_objs array - needed to make change. */ |
625 | /* Fill in any gaps in the coin_objs array - needed to make change. */ |
626 | /* Note that the coin_objs array goes from least value to greatest value */ |
626 | /* Note that the coin_objs array goes from least value to greatest value */ |
627 | for (i = 0; i < NUM_COINS; i++) |
627 | for (i = 0; i < NUM_COINS; i++) |
628 | if (!coin_objs[i]) |
628 | if (!coin_objs[i]) |
629 | { |
629 | { |
630 | at = find_archetype (coins[NUM_COINS - 1 - i]); |
630 | at = archetype::find (coins[NUM_COINS - 1 - i]); |
631 | |
631 | |
632 | if (at == NULL) |
632 | if (at == NULL) |
633 | LOG (llevError, "Could not find %s archetype\n", coins[NUM_COINS - 1 - i]); |
633 | LOG (llevError, "Could not find %s archetype\n", coins[NUM_COINS - 1 - i]); |
634 | |
634 | |
635 | coin_objs[i] = arch_to_object (at); |
635 | coin_objs[i] = arch_to_object (at); |
… | |
… | |
800 | archetype *at = 0; |
800 | archetype *at = 0; |
801 | object *pouch = 0, *tmp = 0; |
801 | object *pouch = 0, *tmp = 0; |
802 | |
802 | |
803 | for (count = 0; coins[count] != NULL; count++) |
803 | for (count = 0; coins[count] != NULL; count++) |
804 | { |
804 | { |
805 | at = find_archetype (coins[count]); |
805 | at = archetype::find (coins[count]); |
806 | |
806 | |
807 | if (at == NULL) |
807 | if (at == NULL) |
808 | LOG (llevError, "Could not find %s archetype\n", coins[count]); |
808 | LOG (llevError, "Could not find %s archetype\n", coins[count]); |
809 | else if ((amount / at->clone.value) > 0) |
809 | else if ((amount / at->clone.value) > 0) |
810 | { |
810 | { |
… | |
… | |
857 | |
857 | |
858 | /* elmex: this is for the bank plugin :( */ |
858 | /* elmex: this is for the bank plugin :( */ |
859 | sint64 |
859 | sint64 |
860 | pay_player_arch (object *pl, const char *arch, sint64 amount) |
860 | pay_player_arch (object *pl, const char *arch, sint64 amount) |
861 | { |
861 | { |
862 | archetype *at = find_archetype (arch); |
862 | archetype *at = archetype::find (arch); |
863 | object *tmp = NULL; |
863 | object *tmp = NULL; |
864 | |
864 | |
865 | if (at == NULL) |
865 | if (at == NULL) |
866 | return 0; |
866 | return 0; |
867 | |
867 | |