version 1.29 | | version 1.30 |
---|
| | |
/* | | /* |
* static char *rcsid_shop_c = | | * static char *rcsid_shop_c = |
* "$Id: shop.c,v 1.29 2004/05/03 21:38:48 ryo_saeba Exp $"; | | * "$Id: shop.c,v 1.30 2004/05/06 07:04:23 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
*/ | | */ |
uint64 pay_from_container(object *op, object *pouch, int to_pay) { | | uint64 pay_from_container(object *op, object *pouch, int to_pay) { |
int count, i; | | int count, i; |
uint64 remain; | | sint64 remain; |
object *tmp, *coin_objs[NUM_COINS], *next; | | object *tmp, *coin_objs[NUM_COINS], *next; |
archetype *at; | | archetype *at; |
object *who; | | object *who; |
| | |
} else { | | } else { |
num_coins = coin_objs[i]->nrof; | | num_coins = coin_objs[i]->nrof; |
} | | } |
| | remain -= (sint64) num_coins * (sint64)coin_objs[i]->value; |
remain -= (uint64)num_coins * (uint64)coin_objs[i]->value; | | |
coin_objs[i]->nrof -= num_coins; | | coin_objs[i]->nrof -= num_coins; |
/* Now start making change. Start at the coin value | | /* Now start making change. Start at the coin value |
* below the one we just did, and work down to | | * below the one we just did, and work down to |