(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
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue