| version 1.8 | | version 1.9 |
|---|
| | |
| /* | | /* |
| * static char *rcsid_shop_c = | | * static char *rcsid_shop_c = |
| * "$Id: shop.c,v 1.8 2001/05/08 23:10:26 mwedel Exp $"; | | * "$Id: shop.c,v 1.9 2001/05/09 06:58:12 mwedel Exp $"; |
| */ | | */ |
| | | |
| /* | | /* |
| | |
| if ( pouch->type==CONTAINER && QUERY_FLAG(pouch, FLAG_APPLIED) && pouch->race && strstr(pouch->race, "gold") ) { | | if ( pouch->type==CONTAINER && QUERY_FLAG(pouch, FLAG_APPLIED) && pouch->race && strstr(pouch->race, "gold") ) { |
| int w = at->clone.weight * (100-pouch->stats.Str)/100; | | int w = at->clone.weight * (100-pouch->stats.Str)/100; |
| int n = i/at->clone.value; | | int n = i/at->clone.value; |
| | | |
| | | if (w==0) w=1; /* Prevent divide by zero */ |
| if ( n>0 && (!pouch->weight_limit || pouch->carrying+w<=pouch->weight_limit)) { | | if ( n>0 && (!pouch->weight_limit || pouch->carrying+w<=pouch->weight_limit)) { |
| if (pouch->weight_limit && (pouch->weight_limit-pouch->carrying)/w<n) { | | if (pouch->weight_limit && (pouch->weight_limit-pouch->carrying)/w<n) { |
| n = (pouch->weight_limit-pouch->carrying)/w; | | n = (pouch->weight_limit-pouch->carrying)/w; |