(comstr, buy, check_market, display_mark, reset, sell): Change comstr

member com_type from mnemo character to item type.
(whichitem): Unused, remove.

(check_market): Use full item name instead of mnemo in telegrams.

(display_mark): Separate arguments for item type and cheapest only.
Cheapest only of specific item type is not implemented.

(rese): Guard against bad com_type.  Delete some code that had no
effect.
This commit is contained in:
Markus Armbruster 2004-04-10 18:48:30 +00:00
parent 988f9a8be7
commit ca80c373bf
8 changed files with 35 additions and 59 deletions

View file

@ -57,7 +57,6 @@ rese(void)
{
struct comstr comm;
struct sctstr sect;
struct ichrstr *ix;
int number_set;
int m;
char *p;
@ -117,18 +116,19 @@ rese(void)
pr("The destination sector must be at least 60%% efficient.\n");
return RET_OK;
}
ix = whichitem(comm.com_type);
sect.sct_x = comm.sell_x;
sect.sct_y = comm.sell_y;
m = sect.sct_item[ix->i_vtype];
if (CANT_HAPPEN((unsigned)comm.com_type > I_MAX)) {
pr("The goods have been eaten by a grue.");
return RET_OK;
}
m = sect.sct_item[comm.com_type];
m = m + comm.com_amount;
if (m > ITEM_MAX)
m = ITEM_MAX;
sect.sct_item[ix->i_vtype] = m;
sect.sct_item[comm.com_type] = m;
putsect(&sect);
comm.com_owner = 0;
putcomm(number_set, &comm);
pr("The goods have been returned to your trading post\n");
pr("The goods have been returned to your trading post.\n");
return RET_OK;
}
if (price >= comm.com_price) {