| version 1.50 | | version 1.51 |
|---|
| | |
| /* | | /* |
| * static char *rcsid_shop_c = | | * static char *rcsid_shop_c = |
| * "$Id: shop.c,v 1.50 2005/11/19 21:05:30 cavesomething Exp $"; | | * "$Id: shop.c,v 1.51 2006/02/04 15:46:24 akirschbaum Exp $"; |
| */ | | */ |
| | | |
| /* | | /* |
| | |
| object *item; | | object *item; |
| uint32 coincount[NUM_COINS]; | | uint32 coincount[NUM_COINS]; |
| if (!pl || pl->type != PLAYER) { | | if (!pl || pl->type != PLAYER) { |
| LOG(llevError, "can_pay(): called against something that isn't a player"); | | LOG(llevError, "can_pay(): called against something that isn't a player\n"); |
| return 0; | | return 0; |
| } | | } |
| for (i=0; i< NUM_COINS; i++) coincount[i] = 0; | | for (i=0; i< NUM_COINS; i++) coincount[i] = 0; |
| | |
| int i; | | int i; |
| | | |
| if (item==NULL) { | | if (item==NULL) { |
| LOG(llevError, "shop_specialisation_ratio: passed a NULL item for map %s", map->path); | | LOG(llevError, "shop_specialisation_ratio: passed a NULL item for map %s\n", map->path); |
| return 0; | | return 0; |
| } | | } |
| if (!item->type) { | | if (!item->type) { |
| LOG(llevError, "shop_specialisation_ratio: passed an item with an invalid type"); | | LOG(llevError, "shop_specialisation_ratio: passed an item with an invalid type\n"); |
| /* | | /* |
| * I'm not really sure what the /right/ thing to do here is, these types of | | * I'm not really sure what the /right/ thing to do here is, these types of |
| * item shouldn't exist anyway, but returning the ratio is probably the best bet.." | | * item shouldn't exist anyway, but returning the ratio is probably the best bet.." |
| | |
| newval=unit_price; | | newval=unit_price; |
| } else { | | } else { |
| if (!who->map) { | | if (!who->map) { |
| LOG(llevError, "value_limit: asked shop price for ob %s on NULL map", who->name); | | LOG(llevError, "value_limit: asked shop price for ob %s on NULL map\n", who->name); |
| return val; | | return val; |
| } | | } |
| map=who->map; | | map=who->map; |