(genitem, ship, plane, land): Remove unused member sell & equivalents.
(genitem_ca, ship_ca, plane_ca, land_ca): Remove selector "sell". (comstr, trdstr): Members trd_price, com_price have no effect. Use them instead of trd_maxprice, com_maxprice and remove the latter. (commodity_ca, trade_ca): Remove selector "maxprice".
This commit is contained in:
parent
95b650396a
commit
bb811df758
15 changed files with 19 additions and 36 deletions
|
@ -44,7 +44,6 @@ struct comstr {
|
|||
int com_amount;
|
||||
float com_price;
|
||||
int com_maxbidder;
|
||||
float com_maxprice;
|
||||
time_t com_markettime;
|
||||
coord com_x;
|
||||
coord com_y;
|
||||
|
|
|
@ -50,7 +50,6 @@ struct genitem {
|
|||
s_char type;
|
||||
s_char effic;
|
||||
s_char mobil;
|
||||
short sell;
|
||||
short tech;
|
||||
s_char group;
|
||||
coord opx, opy;
|
||||
|
|
|
@ -56,7 +56,6 @@ struct lndstr {
|
|||
s_char lnd_type; /* index in lchr[] */
|
||||
s_char lnd_effic; /* 0% to 100% */
|
||||
s_char lnd_mobil; /* mobility units made int for RS/6000 */
|
||||
short lnd_sell; /* pointer to trade file */
|
||||
short lnd_tech; /* tech level ship was built at */
|
||||
s_char lnd_army; /* group membership */
|
||||
coord lnd_opx, lnd_opy; /* Op sector coords */
|
||||
|
|
|
@ -54,7 +54,6 @@ struct plnstr {
|
|||
s_char pln_type; /* index in plchr[] */
|
||||
s_char pln_effic; /* actually "training" */
|
||||
s_char pln_mobil; /* plane mobility */
|
||||
short pln_sell; /* index into trade file */
|
||||
short pln_tech; /* plane's tech level */
|
||||
s_char pln_wing; /* like fleet */
|
||||
coord pln_opx; /* Op sector coords */
|
||||
|
|
|
@ -75,7 +75,6 @@ struct shpstr {
|
|||
s_char shp_type; /* index in mchr[] */
|
||||
s_char shp_effic; /* 0% to 100% */
|
||||
s_char shp_mobil; /* mobility units */
|
||||
short shp_sell; /* pointer to trade file */
|
||||
short shp_tech; /* tech level ship was built at */
|
||||
s_char shp_fleet; /* group membership */
|
||||
coord shp_opx, shp_opy; /* Op sector coords */
|
||||
|
|
|
@ -51,7 +51,6 @@ struct trdstr {
|
|||
short trd_unitid;
|
||||
long trd_price;
|
||||
int trd_maxbidder;
|
||||
int trd_maxprice;
|
||||
time_t trd_markettime;
|
||||
coord trd_x;
|
||||
coord trd_y;
|
||||
|
|
|
@ -436,7 +436,6 @@ build_ship(register struct sctstr *sp, register struct mchrstr *mp,
|
|||
ship.shp_nchoppers = 0;
|
||||
ship.shp_fleet = ' ';
|
||||
ship.shp_nv = 0;
|
||||
ship.shp_sell = 0;
|
||||
ship.shp_tech = tlev;
|
||||
|
||||
techdiff = (int)(tlev - mp->m_tech);
|
||||
|
@ -572,7 +571,6 @@ build_land(register struct sctstr *sp, register struct lchrstr *lp,
|
|||
} else {
|
||||
land.lnd_mobil = 0;
|
||||
}
|
||||
land.lnd_sell = 0;
|
||||
land.lnd_tech = tlev;
|
||||
land.lnd_uid = nstr.cur;
|
||||
land.lnd_army = ' ';
|
||||
|
@ -617,12 +615,12 @@ build_land(register struct sctstr *sp, register struct lchrstr *lp,
|
|||
(vec[I_CIVIL] + vec[I_MILIT] + vec[I_UW])+1;
|
||||
if ((vec[I_FOOD]-max_amt) < food_needed)
|
||||
max_amt = (vec[I_FOOD]-food_needed);
|
||||
|
||||
|
||||
if (max_amt < 0)
|
||||
max_amt = 0;
|
||||
|
||||
|
||||
vec[I_FOOD] -= max_amt;
|
||||
|
||||
|
||||
memset(lvec, 0, sizeof(lvec));
|
||||
getvec(VT_ITEM, lvec, (s_char *)&land, EF_LAND);
|
||||
lvec[I_FOOD] += max_amt;
|
||||
|
@ -975,7 +973,6 @@ build_plane(register struct sctstr *sp, register struct plchrstr *pp,
|
|||
plane.pln_uid = nstr.cur;
|
||||
plane.pln_nuketype = -1;
|
||||
plane.pln_harden = 0;
|
||||
plane.pln_sell = 0;
|
||||
plane.pln_flags = 0;
|
||||
makenotlost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x,
|
||||
plane.pln_y);
|
||||
|
|
|
@ -127,13 +127,13 @@ buy(void)
|
|||
for (q = 0; gettrade(q, &tmpt); q++) {
|
||||
if (tmpt.trd_maxbidder == player->cnum &&
|
||||
tmpt.trd_unitid >= 0 && tmpt.trd_owner != player->cnum) {
|
||||
tally += tmpt.trd_maxprice * tradetax;
|
||||
tally += tmpt.trd_price * tradetax;
|
||||
}
|
||||
}
|
||||
for (q = 0; getcomm(q, &comt); q++) {
|
||||
if (comt.com_maxbidder == player->cnum &&
|
||||
comt.com_owner != 0 && comt.com_owner != player->cnum) {
|
||||
tally += (comt.com_maxprice * comt.com_amount) * buytax;
|
||||
tally += (comt.com_price * comt.com_amount) * buytax;
|
||||
}
|
||||
}
|
||||
canspend = natp->nat_money - tally;
|
||||
|
@ -188,8 +188,8 @@ buy(void)
|
|||
pr("That lot has been taken off the market.\n");
|
||||
return RET_FAIL;
|
||||
}
|
||||
if (bid > 0.04 + comm.com_maxprice) {
|
||||
comm.com_maxprice = bid;
|
||||
if (bid > 0.04 + comm.com_price) {
|
||||
comm.com_price = bid;
|
||||
/* Add five minutes to the time if less than 5 minutes */
|
||||
time(&now);
|
||||
if (((MARK_DELAY - (now - comm.com_markettime)) < 300) &&
|
||||
|
@ -254,8 +254,8 @@ check_market(void)
|
|||
|
||||
monleft = 0;
|
||||
|
||||
price = comm.com_maxprice * comm.com_amount * buytax;
|
||||
gain = comm.com_maxprice * comm.com_amount;
|
||||
price = comm.com_price * comm.com_amount * buytax;
|
||||
gain = comm.com_price * comm.com_amount;
|
||||
|
||||
natp = getnatp(comm.com_maxbidder);
|
||||
tmoney = natp->nat_money;
|
||||
|
|
|
@ -68,7 +68,7 @@ pr_mark(struct comstr *comm)
|
|||
tleft = 0.0;
|
||||
pr(" %3d $%12.2f %2d %5.2f hrs (%3d) %c %6d ",
|
||||
comm->com_uid,
|
||||
comm->com_maxprice,
|
||||
comm->com_price,
|
||||
comm->com_maxbidder,
|
||||
tleft, comm->com_owner, comm->com_type, comm->com_amount);
|
||||
if (comm->com_owner == player->cnum || player->god)
|
||||
|
@ -127,7 +127,7 @@ display_mark(s_char *arg)
|
|||
continue;
|
||||
if (cheapest_items[i] != -1) {
|
||||
getcomm(cheapest_items[i], &comm2);
|
||||
if (comm.com_maxprice < comm2.com_maxprice) {
|
||||
if (comm.com_price < comm2.com_price) {
|
||||
cheapest_items[i] = sellers;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -333,7 +333,6 @@ deity_build_land(int type, coord x, coord y, natid own, int tlev)
|
|||
land.lnd_type = type;
|
||||
land.lnd_effic = 100;
|
||||
land.lnd_mobil = land_mob_max;
|
||||
land.lnd_sell = 0;
|
||||
land.lnd_tech = tlev;
|
||||
land.lnd_uid = nstr.cur;
|
||||
land.lnd_army = ' ';
|
||||
|
|
|
@ -142,8 +142,6 @@ rese(void)
|
|||
comm.com_price = price;
|
||||
(void)time(&now);
|
||||
comm.com_markettime = now;
|
||||
if ((int)price < comm.com_maxprice)
|
||||
comm.com_maxprice = (int)price;
|
||||
if (!putcomm(number_set, &comm)) {
|
||||
pr("Problems with the commodities file, Call the Deity\n");
|
||||
return RET_OK;
|
||||
|
|
|
@ -182,7 +182,6 @@ sell(void)
|
|||
comm.com_owner = player->cnum;
|
||||
comm.com_price = price;
|
||||
comm.com_maxbidder = player->cnum;
|
||||
comm.com_maxprice = price;
|
||||
comm.com_markettime = now;
|
||||
comm.com_amount = totalcom;
|
||||
comm.com_x = 0;
|
||||
|
|
|
@ -148,7 +148,6 @@ set(void)
|
|||
(void)time(&now);
|
||||
trade.trd_markettime = now;
|
||||
trade.trd_maxbidder = player->cnum;
|
||||
trade.trd_maxprice = 0;
|
||||
puttrade(ni_trade.cur, &trade);
|
||||
} else if (price > 0) {
|
||||
trade.trd_x = item.gen.trg_x;
|
||||
|
@ -160,7 +159,6 @@ set(void)
|
|||
(void)time(&now);
|
||||
trade.trd_markettime = now;
|
||||
trade.trd_maxbidder = player->cnum;
|
||||
trade.trd_maxprice = price;
|
||||
if (foundslot >= 0)
|
||||
id = foundslot;
|
||||
else if (freeslot >= 0)
|
||||
|
|
|
@ -115,7 +115,7 @@ trad(void)
|
|||
TRADE_DELAY / 3600.0 - (now - trade.trd_markettime) / 3600.0;
|
||||
if (tleft < 0.0)
|
||||
tleft = 0.0;
|
||||
pr("$%7d %2d %5.2f hrs ", trade.trd_maxprice,
|
||||
pr("$%7d %2d %5.2f hrs ", trade.trd_price,
|
||||
trade.trd_maxbidder, tleft);
|
||||
(void)trade_desc(&trade, &tg); /* XXX */
|
||||
pr("\n");
|
||||
|
@ -174,7 +174,7 @@ trad(void)
|
|||
pr("You can't buy from yourself!\n");
|
||||
return RET_OK;
|
||||
}
|
||||
price = trade.trd_maxprice;
|
||||
price = trade.trd_price;
|
||||
natp = getnatp(player->cnum);
|
||||
if (natp->nat_money < price) {
|
||||
pr("You don't have %.2f to spend!\n", price);
|
||||
|
@ -184,13 +184,13 @@ trad(void)
|
|||
for (q = 0; gettrade(q, &tmpt); q++) {
|
||||
if (tmpt.trd_maxbidder == player->cnum &&
|
||||
tmpt.trd_unitid >= 0 && tmpt.trd_owner != player->cnum) {
|
||||
tally += tmpt.trd_maxprice * tradetax;
|
||||
tally += tmpt.trd_price * tradetax;
|
||||
}
|
||||
}
|
||||
for (q = 0; getcomm(q, &comt); q++) {
|
||||
if (comt.com_maxbidder == player->cnum &&
|
||||
comt.com_owner != 0 && comt.com_owner != player->cnum) {
|
||||
tally += (comt.com_maxprice * comt.com_amount) * buytax;
|
||||
tally += (comt.com_price * comt.com_amount) * buytax;
|
||||
}
|
||||
}
|
||||
canspend = natp->nat_money - tally;
|
||||
|
@ -275,13 +275,13 @@ trad(void)
|
|||
pr("You don't have %.2f to spend!\n", price);
|
||||
return RET_OK;
|
||||
}
|
||||
if (bid > trade.trd_maxprice) {
|
||||
if (bid > trade.trd_price) {
|
||||
/* Add five minutes to the time if less than 5 minutes left. */
|
||||
time(&now);
|
||||
if (((TRADE_DELAY - (now - trade.trd_markettime)) < 300) &&
|
||||
trade.trd_maxbidder != player->cnum)
|
||||
trade.trd_markettime += 300;
|
||||
trade.trd_maxprice = bid;
|
||||
trade.trd_price = bid;
|
||||
trade.trd_maxbidder = player->cnum;
|
||||
trade.trd_x = sx;
|
||||
trade.trd_y = sy;
|
||||
|
@ -355,7 +355,7 @@ check_trade(void)
|
|||
}
|
||||
|
||||
monleft = 0;
|
||||
price = trade.trd_maxprice;
|
||||
price = trade.trd_price;
|
||||
natp = getnatp(trade.trd_maxbidder);
|
||||
if (natp->nat_money <= 0)
|
||||
monleft = price;
|
||||
|
|
|
@ -142,7 +142,6 @@ struct castr sect_ca[] = {
|
|||
{ NSC_UCHAR | NSC_OFF | fldoff(genitem, type), "type", 0},\
|
||||
{ NSC_UCHAR | NSC_OFF | fldoff(genitem, effic), "effic", 0},\
|
||||
{ NSC_CHAR | NSC_OFF | fldoff(genitem, mobil), "mobil", 0},\
|
||||
{ NSC_SHORT | NSC_OFF | fldoff(genitem, sell), "sell", 0},\
|
||||
{ NSC_SHORT | NSC_OFF | fldoff(genitem, tech), "tech", 0},\
|
||||
{ NSC_CHAR | NSC_OFF | fldoff(genitem, group), "group", 0},\
|
||||
{ NSC_XCOORD | NSC_OFF | fldoff(genitem, opx), "opx", 0},\
|
||||
|
@ -274,7 +273,6 @@ struct castr commodity_ca[] = {
|
|||
{NSC_UCHAR | NSC_OFF | fldoff(comstr, com_type), "type", 0},
|
||||
{NSC_INT | NSC_OFF | fldoff(comstr, com_amount), "amount", 0},
|
||||
{NSC_INT | NSC_OFF | fldoff(comstr, com_maxbidder), "maxbidder", 0},
|
||||
{NSC_FLOAT | NSC_OFF | fldoff(comstr, com_maxprice), "maxprice", 0},
|
||||
{NSC_TIME | NSC_OFF | fldoff(comstr, com_markettime), "markettime", 0},
|
||||
/* could let maxbidder access these, but we can't express that yet: */
|
||||
{NSC_DEITY | NSC_INT | NSC_OFF | fldoff(comstr, com_x), "xbuy", 0},
|
||||
|
@ -293,8 +291,8 @@ struct castr trade_ca[] = {
|
|||
{NSC_SHORT | NSC_OFF | fldoff(trdstr, trd_unitid), "unitid", 0},
|
||||
{NSC_LONG | NSC_OFF | fldoff(trdstr, trd_price), "price", 0},
|
||||
{NSC_INT | NSC_OFF | fldoff(trdstr, trd_maxbidder), "maxbidder", 0},
|
||||
{NSC_INT | NSC_OFF | fldoff(trdstr, trd_maxprice), "maxprice", 0},
|
||||
{NSC_TIME | NSC_OFF | fldoff(trdstr, trd_markettime), "markettime", 0},
|
||||
/* could let the owner access these, but we can't express that yet: */
|
||||
{NSC_DEITY | NSC_XCOORD | NSC_OFF | fldoff(trdstr, trd_x), "xloc", 0},
|
||||
{NSC_DEITY | NSC_YCOORD | NSC_OFF | fldoff(trdstr, trd_y), "yloc", 0},
|
||||
{0, 0, 0}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue