| version 1.47 | | version 1.48 |
|---|
| | |
| /* | | /* |
| * static char *rcsid_shop_c = | | * static char *rcsid_shop_c = |
| * "$Id: shop.c,v 1.47 2005/10/28 19:08:53 akirschbaum Exp $"; | | * "$Id: shop.c,v 1.48 2005/11/05 20:38:24 akirschbaum Exp $"; |
| */ | | */ |
| | | |
| /* | | /* |
| | |
| uint64 newval, unit_price; | | uint64 newval, unit_price; |
| mapstruct *map; | | mapstruct *map; |
| unit_price=val/quantity; | | unit_price=val/quantity; |
| newval=unit_price; | | |
| if (!isshop || !who) { | | if (!isshop || !who) { |
| | | if (unit_price > 10000) |
| newval=8000+isqrt(unit_price)*20; | | newval=8000+isqrt(unit_price)*20; |
| } | | else |
| else { | | newval=unit_price; |
| | | } 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", who->name); |
| return val; | | return val; |
| | |
| newval=MIN((map->shopmax/2)+isqrt(unit_price-map->shopmax/2), map->shopmax); | | newval=MIN((map->shopmax/2)+isqrt(unit_price-map->shopmax/2), map->shopmax); |
| else if (unit_price>10000) | | else if (unit_price>10000) |
| newval=8000+isqrt(unit_price)*20; | | newval=8000+isqrt(unit_price)*20; |
| | | else |
| | | newval=unit_price; |
| } | | } |
| newval *= quantity; | | newval *= quantity; |
| return newval; | | return newval; |