|
From: <gjh...@us...> - 2003-09-05 20:31:17
|
Update of /cvsroot/mistmud/mistmud
In directory sc8-pr-cvs1:/tmp/cvs-serv27459
Modified Files:
Tag: rev_1_3
coins.c
Log Message:
- make PayToFrom() remove extra coins from biggest to smallest, gets rid of
as many coins as possible
Index: coins.c
===================================================================
RCS file: /cvsroot/mistmud/mistmud/Attic/coins.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** coins.c 1 Sep 2003 15:53:06 -0000 1.1.2.2
--- coins.c 5 Sep 2003 20:31:14 -0000 1.1.2.3
***************
*** 129,133 ****
remValue = totValue - amount;
! for( i = 0; i < MAX_COIN_TYPE && remValue > 0; i++ ) {
count = remValue / coinDef[i].value;
has = MAX( MIN( coins[i], count ), 0 );
--- 129,133 ----
remValue = totValue - amount;
! for( i = MAX_COIN_TYPE - 1; i >= 0 && remValue > 0; i-- ) {
count = remValue / coinDef[i].value;
has = MAX( MIN( coins[i], count ), 0 );
|