(ichrstr): Rename member i_vtype to i_uid.

(ichr_ca): Rename selector vtype to uid.
This commit is contained in:
Markus Armbruster 2006-02-20 05:35:58 +00:00
parent 96a1e8277a
commit 783b00bbad
24 changed files with 59 additions and 59 deletions

View file

@ -69,7 +69,7 @@ typedef enum {
struct ichrstr { struct ichrstr {
char i_mnem; /* usually the initial letter */ char i_mnem; /* usually the initial letter */
i_type i_vtype; /* var type */ i_type i_uid; /* index in ichr[] */
int i_value; /* mortgage value */ int i_value; /* mortgage value */
int i_sell; /* can this be sold? */ int i_sell; /* can this be sold? */
int i_lbs; /* how hard to move */ int i_lbs; /* how hard to move */

View file

@ -449,8 +449,8 @@ comm_bomb(struct emp_qelem *list, struct sctstr *target)
return; return;
getsect(target->sct_x, target->sct_y, &sect); getsect(target->sct_x, target->sct_y, &sect);
target = § target = §
before = amt = target->sct_item[ip->i_vtype]; before = amt = target->sct_item[ip->i_uid];
target->sct_item[ip->i_vtype] = amt = commdamage(amt, dam, ip->i_vtype); target->sct_item[ip->i_uid] = amt = commdamage(amt, dam, ip->i_uid);
if (before > 0.0) if (before > 0.0)
b = 100.0 * (1.0 - ((float)amt / (float)before)); b = 100.0 * (1.0 - ((float)amt / (float)before));
else else

View file

@ -85,7 +85,7 @@ buy(void)
ip = whatitem(player->argp[1], "Commodity you want to buy: "); ip = whatitem(player->argp[1], "Commodity you want to buy: ");
if (!ip) if (!ip)
return RET_SYN; return RET_SYN;
display_mark(ip->i_vtype, 0); display_mark(ip->i_uid, 0);
pr("\n"); pr("\n");
p = getstarg(player->argp[2], "Which lot are you bidding on: ", buf); p = getstarg(player->argp[2], "Which lot are you bidding on: ", buf);
if (p == 0) if (p == 0)
@ -99,7 +99,7 @@ buy(void)
pr("Invalid lot number.\n"); pr("Invalid lot number.\n");
return RET_OK; return RET_OK;
} }
if (comm.com_type != ip->i_vtype) { if (comm.com_type != ip->i_uid) {
pr("That lot is not of the type you specified.\n"); pr("That lot is not of the type you specified.\n");
return RET_OK; return RET_OK;
} }
@ -158,7 +158,7 @@ buy(void)
pr("That sector is under construction.\n"); pr("That sector is under construction.\n");
return RET_FAIL; return RET_FAIL;
} }
n = sect.sct_item[ip->i_vtype]; n = sect.sct_item[ip->i_uid];
qty = comm.com_amount; qty = comm.com_amount;
if (qty + n > ITEM_MAX) { if (qty + n > ITEM_MAX) {
pr("That sector cannot hold %d more %s. It currently holds %d.\n", pr("That sector cannot hold %d more %s. It currently holds %d.\n",

View file

@ -101,9 +101,9 @@ coll(void)
} }
pay = dchr[sect.sct_type].d_value * ((float)sect.sct_effic + 100.0); pay = dchr[sect.sct_type].d_value * ((float)sect.sct_effic + 100.0);
for (i = 0; ichr[i].i_name; i++) { for (i = 0; ichr[i].i_name; i++) {
if (ichr[i].i_value == 0 || ichr[i].i_vtype == I_NONE) if (ichr[i].i_value == 0 || ichr[i].i_uid == I_NONE)
continue; continue;
val = sect.sct_item[ichr[i].i_vtype]; val = sect.sct_item[ichr[i].i_uid];
pay += val * ichr[i].i_value; pay += val * ichr[i].i_value;
} }
pr("That sector (and its contents) is valued at $%.2f\n", pay); pr("That sector (and its contents) is valued at $%.2f\n", pay);

View file

@ -60,7 +60,7 @@ deli(void)
if ((ich = whatitem(player->argp[1], "deliver what? ")) == 0) if ((ich = whatitem(player->argp[1], "deliver what? ")) == 0)
return RET_SYN; return RET_SYN;
/* /*
if (ich->i_vtype == I_CIVIL || ich->i_vtype == I_MILIT) { if (ich->i_uid == I_CIVIL || ich->i_uid == I_MILIT) {
pr("You cannot deliver people!\n"); pr("You cannot deliver people!\n");
return RET_FAIL; return RET_FAIL;
} }
@ -72,7 +72,7 @@ deli(void)
if (!player->owner) if (!player->owner)
continue; continue;
del = sect.sct_del[ich->i_vtype]; del = sect.sct_del[ich->i_uid];
thresh = del & ~0x7; thresh = del & ~0x7;
dir = del & 0x7; dir = del & 0x7;
@ -107,7 +107,7 @@ deli(void)
thresh = MIN(thresh, ITEM_MAX) & ~7; thresh = MIN(thresh, ITEM_MAX) & ~7;
del = thresh | dir; del = thresh | dir;
sect.sct_del[ich->i_vtype] = del; sect.sct_del[ich->i_uid] = del;
putsect(&sect); putsect(&sect);
} }

View file

@ -87,13 +87,13 @@ drop(void)
if (target.sct_own == player->cnum if (target.sct_own == player->cnum
|| getrel(getnatp(target.sct_own), player->cnum) == ALLIED) { || getrel(getnatp(target.sct_own), player->cnum) == ALLIED) {
if (ip->i_vtype == I_CIVIL && target.sct_own != target.sct_oldown) { if (ip->i_uid == I_CIVIL && target.sct_own != target.sct_oldown) {
pr("Can't drop civilians into occupied sectors.\n"); pr("Can't drop civilians into occupied sectors.\n");
return RET_FAIL; return RET_FAIL;
} }
} else { } else {
/* into the unknown... */ /* into the unknown... */
if (ip->i_vtype != I_SHELL) { if (ip->i_uid != I_SHELL) {
pr("You don't own %s!\n", xyas(tx, ty, player->cnum)); pr("You don't own %s!\n", xyas(tx, ty, player->cnum));
return RET_FAIL; return RET_FAIL;
} }

View file

@ -75,7 +75,7 @@ explore(void)
if (!(ip = whatitem(player->argp[1], "explore with what? (civ/mil) "))) if (!(ip = whatitem(player->argp[1], "explore with what? (civ/mil) ")))
return RET_SYN; return RET_SYN;
vtype = ip->i_vtype; vtype = ip->i_uid;
if ((vtype != I_CIVIL) && (vtype != I_MILIT)) { if ((vtype != I_CIVIL) && (vtype != I_MILIT)) {
pr("You can only explore with civs and mil.\n"); pr("You can only explore with civs and mil.\n");
return RET_FAIL; return RET_FAIL;

View file

@ -103,7 +103,7 @@ fly(void)
dst_type = EF_SHIP; dst_type = EF_SHIP;
} }
if (ip && ip->i_vtype == I_CIVIL && target.sct_own != target.sct_oldown) { if (ip && ip->i_uid == I_CIVIL && target.sct_own != target.sct_oldown) {
pr("Can't fly civilians into occupied sectors.\n"); pr("Can't fly civilians into occupied sectors.\n");
return RET_FAIL; return RET_FAIL;
} }

View file

@ -70,14 +70,14 @@ give(void)
return RET_SYN; return RET_SYN;
if ((amt = atoi(p)) == 0) if ((amt = atoi(p)) == 0)
return RET_SYN; return RET_SYN;
n = sect.sct_item[ip->i_vtype]; n = sect.sct_item[ip->i_uid];
if (amt < 0 && -amt > n) { if (amt < 0 && -amt > n) {
m = 0; m = 0;
} else if (amt > 0 && amt + n > ITEM_MAX) { } else if (amt > 0 && amt + n > ITEM_MAX) {
m = ITEM_MAX; m = ITEM_MAX;
} else } else
m = n + amt; m = n + amt;
sect.sct_item[ip->i_vtype] = m; sect.sct_item[ip->i_uid] = m;
putsect(&sect); putsect(&sect);
if (sect.sct_own != 0 && m != n) { if (sect.sct_own != 0 && m != n) {
if (m > n) { if (m > n) {

View file

@ -725,7 +725,7 @@ static int
load_comm_ship(struct sctstr *sectp, struct shpstr *sp, load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
struct ichrstr *ich, int load_unload, int *nshipsp) struct ichrstr *ich, int load_unload, int *nshipsp)
{ {
i_type item = ich->i_vtype; i_type item = ich->i_uid;
struct mchrstr *mcp = &mchr[(int)sp->shp_type]; struct mchrstr *mcp = &mchr[(int)sp->shp_type];
int ship_amt, ship_max, sect_amt, move_amt; int ship_amt, ship_max, sect_amt, move_amt;
int amount; int amount;
@ -928,7 +928,7 @@ static int
load_comm_land(struct sctstr *sectp, struct lndstr *lp, load_comm_land(struct sctstr *sectp, struct lndstr *lp,
struct ichrstr *ich, int load_unload, int *nunitsp) struct ichrstr *ich, int load_unload, int *nunitsp)
{ {
i_type item = ich->i_vtype; i_type item = ich->i_uid;
struct lchrstr *lcp = &lchr[(int)lp->lnd_type]; struct lchrstr *lcp = &lchr[(int)lp->lnd_type];
int land_amt, land_max, sect_amt, move_amt; int land_amt, land_max, sect_amt, move_amt;
int amount; int amount;

View file

@ -86,13 +86,13 @@ ltend(void)
return RET_FAIL; return RET_FAIL;
if ((amt = atoi(p)) == 0) if ((amt = atoi(p)) == 0)
break; break;
ontender = tender.shp_item[ip->i_vtype]; ontender = tender.shp_item[ip->i_uid];
if (ontender == 0 && amt > 0) { if (ontender == 0 && amt > 0) {
pr("No %s on %s\n", ip->i_name, prship(&tender)); pr("No %s on %s\n", ip->i_name, prship(&tender));
return RET_FAIL; return RET_FAIL;
} }
vbase = &mchr[(int)tender.shp_type]; vbase = &mchr[(int)tender.shp_type];
maxtender = vbase->m_item[ip->i_vtype]; maxtender = vbase->m_item[ip->i_uid];
if (maxtender == 0) { if (maxtender == 0) {
pr("A %s cannot hold any %s\n", pr("A %s cannot hold any %s\n",
mchr[(int)tender.shp_type].m_name, ip->i_name); mchr[(int)tender.shp_type].m_name, ip->i_name);
@ -111,14 +111,14 @@ ltend(void)
if (target.lnd_ship != tender.shp_uid) if (target.lnd_ship != tender.shp_uid)
continue; continue;
ontarget = target.lnd_item[ip->i_vtype]; ontarget = target.lnd_item[ip->i_uid];
if (ontarget == 0 && amt < 0) { if (ontarget == 0 && amt < 0) {
pr("No %s on %s\n", pr("No %s on %s\n",
ip->i_name, prland(&target)); ip->i_name, prland(&target));
continue; continue;
} }
lbase = &lchr[(int)target.lnd_type]; lbase = &lchr[(int)target.lnd_type];
maxtarget = lbase->l_item[ip->i_vtype]; maxtarget = lbase->l_item[ip->i_uid];
if (amt < 0) { if (amt < 0) {
if (!player->owner) if (!player->owner)
amt = 0; amt = 0;
@ -128,7 +128,7 @@ ltend(void)
transfer = MIN(maxtender - ontender, transfer); transfer = MIN(maxtender - ontender, transfer);
if (transfer == 0) if (transfer == 0)
continue; continue;
target.lnd_item[ip->i_vtype] = ontarget - transfer; target.lnd_item[ip->i_uid] = ontarget - transfer;
ontender += transfer; ontender += transfer;
total += transfer; total += transfer;
} else { } else {
@ -137,7 +137,7 @@ ltend(void)
transfer = MIN(transfer, maxtarget - ontarget); transfer = MIN(transfer, maxtarget - ontarget);
if (transfer == 0) if (transfer == 0)
continue; continue;
target.lnd_item[ip->i_vtype] = ontarget + transfer; target.lnd_item[ip->i_uid] = ontarget + transfer;
ontender -= transfer; ontender -= transfer;
total += transfer; total += transfer;
} }
@ -151,7 +151,7 @@ ltend(void)
pr("%d total %s transferred %s %s\n", pr("%d total %s transferred %s %s\n",
total, ip->i_name, (amt > 0) ? "off of" : "to", total, ip->i_name, (amt > 0) ? "off of" : "to",
prship(&tender)); prship(&tender));
tender.shp_item[ip->i_vtype] = ontender; tender.shp_item[ip->i_uid] = ontender;
tender.shp_mission = 0; tender.shp_mission = 0;
putship(tender.shp_uid, &tender); putship(tender.shp_uid, &tender);
} }

View file

@ -65,7 +65,7 @@ mark(void)
ip = item_by_name(p); ip = item_by_name(p);
if (!ip) if (!ip)
return RET_SYN; return RET_SYN;
return display_mark(ip->i_vtype, 0); return display_mark(ip->i_uid, 0);
} }
} }
return display_mark(I_NONE, 1); return display_mark(I_NONE, 1);

View file

@ -80,7 +80,7 @@ move(void)
istest = *player->argp[0] == 't'; istest = *player->argp[0] == 't';
if ((ip = whatitem(player->argp[1], "move what? ")) == 0) if ((ip = whatitem(player->argp[1], "move what? ")) == 0)
return RET_SYN; return RET_SYN;
vtype = ip->i_vtype; vtype = ip->i_uid;
if (!(p = getstarg(player->argp[2], "from sector : ", buf))) if (!(p = getstarg(player->argp[2], "from sector : ", buf)))
return RET_SYN; return RET_SYN;
if (!sarg_xy(p, &x, &y)) if (!sarg_xy(p, &x, &y))
@ -193,7 +193,7 @@ move(void)
cmd_move_map, 0, &dam); cmd_move_map, 0, &dam);
if (dam) { if (dam) {
left = commdamage(amount, dam, ip->i_vtype); left = commdamage(amount, dam, ip->i_uid);
if (left < amount) { if (left < amount) {
if (left) { if (left) {
pr("%d of the %s you were moving were destroyed!\n" pr("%d of the %s you were moving were destroyed!\n"

View file

@ -233,7 +233,7 @@ orde(void)
level = 0; /* prevent negatives. */ level = 0; /* prevent negatives. */
pr("You must use positive number! Level set to 0.\n"); pr("You must use positive number! Level set to 0.\n");
} }
ship.shp_tstart[sub] = i1->i_vtype; ship.shp_tstart[sub] = i1->i_uid;
ship.shp_lstart[sub] = level; ship.shp_lstart[sub] = level;
pr("Order Set \n"); pr("Order Set \n");
break; break;
@ -253,7 +253,7 @@ orde(void)
level = 0; level = 0;
pr("You must use positive number! Level set to 0.\n"); pr("You must use positive number! Level set to 0.\n");
} }
ship.shp_tend[sub] = i1->i_vtype; ship.shp_tend[sub] = i1->i_uid;
ship.shp_lend[sub] = level; ship.shp_lend[sub] = level;
pr("Order Set \n"); pr("Order Set \n");
break; break;

View file

@ -74,7 +74,7 @@ rout(void)
if ((ip = whatitem(player->argp[1], "What item? ")) == 0) if ((ip = whatitem(player->argp[1], "What item? ")) == 0)
return RET_SYN; return RET_SYN;
i_del = ip->i_vtype;; i_del = ip->i_uid;;
if (player->argp[2] == NULL) { if (player->argp[2] == NULL) {
if ((str = getstring("(sects)? ", buf1)) == 0) if ((str = getstring("(sects)? ", buf1)) == 0)
return RET_SYN; return RET_SYN;

View file

@ -131,7 +131,7 @@ sell(void)
pr("Military control required to sell goods.\n"); pr("Military control required to sell goods.\n");
return RET_FAIL; return RET_FAIL;
} }
if ((amt = sect.sct_item[ip->i_vtype]) == 0) { if ((amt = sect.sct_item[ip->i_uid]) == 0) {
pr("You don't have any %s to sell there.\n", ip->i_name); pr("You don't have any %s to sell there.\n", ip->i_name);
return RET_FAIL; return RET_FAIL;
} }
@ -145,7 +145,7 @@ sell(void)
amt -= com; amt -= com;
pr("Sold %d %s at %s (%d left)\n", com, ip->i_name, pr("Sold %d %s at %s (%d left)\n", com, ip->i_name,
xyas(sect.sct_x, sect.sct_y, player->cnum), amt); xyas(sect.sct_x, sect.sct_y, player->cnum), amt);
sect.sct_item[ip->i_vtype] = amt; sect.sct_item[ip->i_uid] = amt;
putsect(&sect); putsect(&sect);
if (totalcom > 0) { if (totalcom > 0) {
for (ii = 0; getcomm(ii, &comm); ii++) { for (ii = 0; getcomm(ii, &comm); ii++) {
@ -155,7 +155,7 @@ sell(void)
if (getcomm(ii, &comm) == 0) if (getcomm(ii, &comm) == 0)
ef_extend(EF_COMM, 1); ef_extend(EF_COMM, 1);
(void)time(&now); (void)time(&now);
comm.com_type = ip->i_vtype; comm.com_type = ip->i_uid;
comm.com_owner = player->cnum; comm.com_owner = player->cnum;
comm.com_price = price; comm.com_price = price;
comm.com_maxbidder = player->cnum; comm.com_maxbidder = player->cnum;

View file

@ -65,9 +65,9 @@ shoo(void)
char buf[1024]; char buf[1024];
ip = whatitem(player->argp[1], "Shoot what <civ or uw> "); ip = whatitem(player->argp[1], "Shoot what <civ or uw> ");
if (ip == 0 || (ip->i_vtype != I_CIVIL && ip->i_vtype != I_UW)) if (ip == 0 || (ip->i_uid != I_CIVIL && ip->i_uid != I_UW))
return RET_SYN; return RET_SYN;
item = ip->i_vtype; item = ip->i_uid;
if (!snxtsct(&nstr, player->argp[2])) if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN; return RET_SYN;
sprintf(prompt, "number of %s to shoot? ", ip->i_name); sprintf(prompt, "number of %s to shoot? ", ip->i_name);

View file

@ -116,13 +116,13 @@ tend(void)
pr("Amount must be non-zero!\n"); pr("Amount must be non-zero!\n");
return RET_SYN; return RET_SYN;
} }
ontender = tender.shp_item[ip->i_vtype]; ontender = tender.shp_item[ip->i_uid];
if (ontender == 0 && amt > 0) { if (ontender == 0 && amt > 0) {
pr("No %s on %s\n", ip->i_name, prship(&tender)); pr("No %s on %s\n", ip->i_name, prship(&tender));
return RET_FAIL; return RET_FAIL;
} }
vbase = &mchr[(int)tender.shp_type]; vbase = &mchr[(int)tender.shp_type];
maxtender = vbase->m_item[ip->i_vtype]; maxtender = vbase->m_item[ip->i_uid];
if (maxtender == 0) { if (maxtender == 0) {
pr("A %s cannot hold any %s\n", pr("A %s cannot hold any %s\n",
mchr[(int)tender.shp_type].m_name, ip->i_name); mchr[(int)tender.shp_type].m_name, ip->i_name);
@ -144,13 +144,13 @@ tend(void)
if (tender.shp_x != target.shp_x || if (tender.shp_x != target.shp_x ||
tender.shp_y != target.shp_y) tender.shp_y != target.shp_y)
continue; continue;
ontarget = target.shp_item[ip->i_vtype]; ontarget = target.shp_item[ip->i_uid];
if (ontarget == 0 && amt < 0) { if (ontarget == 0 && amt < 0) {
pr("No %s on %s\n", ip->i_name, prship(&target)); pr("No %s on %s\n", ip->i_name, prship(&target));
continue; continue;
} }
vbase = &mchr[(int)target.shp_type]; vbase = &mchr[(int)target.shp_type];
maxtarget = vbase->m_item[ip->i_vtype]; maxtarget = vbase->m_item[ip->i_uid];
if (amt < 0) { if (amt < 0) {
if (!player->owner) if (!player->owner)
amt = 0; amt = 0;
@ -160,7 +160,7 @@ tend(void)
transfer = MIN(maxtender - ontender, transfer); transfer = MIN(maxtender - ontender, transfer);
if (transfer == 0) if (transfer == 0)
continue; continue;
target.shp_item[ip->i_vtype] = ontarget - transfer; target.shp_item[ip->i_uid] = ontarget - transfer;
ontender += transfer; ontender += transfer;
total += transfer; total += transfer;
} else { } else {
@ -169,7 +169,7 @@ tend(void)
transfer = MIN(transfer, maxtarget - ontarget); transfer = MIN(transfer, maxtarget - ontarget);
if (transfer == 0) if (transfer == 0)
continue; continue;
target.shp_item[ip->i_vtype] = ontarget + transfer; target.shp_item[ip->i_uid] = ontarget + transfer;
ontender -= transfer; ontender -= transfer;
total += transfer; total += transfer;
} }
@ -187,7 +187,7 @@ tend(void)
wu(0, target.shp_own, "%s tended %d %s to %s\n", wu(0, target.shp_own, "%s tended %d %s to %s\n",
cname(player->cnum), total, ip->i_name, prship(&target)); cname(player->cnum), total, ip->i_name, prship(&target));
} }
tender.shp_item[ip->i_vtype] = ontender; tender.shp_item[ip->i_uid] = ontender;
tender.shp_mission = 0; tender.shp_mission = 0;
putship(tender.shp_uid, &tender); putship(tender.shp_uid, &tender);
} }

View file

@ -64,7 +64,7 @@ thre(void)
return RET_SYN; return RET_SYN;
if (!snxtsct(&nstr, player->argp[2])) if (!snxtsct(&nstr, player->argp[2]))
return RET_SYN; return RET_SYN;
type = ip->i_vtype; type = ip->i_uid;
if (player->argp[3] && *player->argp[3] && if (player->argp[3] && *player->argp[3] &&
(*player->argp[3] < '0' || *player->argp[3] > '9')) { (*player->argp[3] < '0' || *player->argp[3] > '9')) {
pr("Threshold must be a number\n"); pr("Threshold must be a number\n");

View file

@ -83,7 +83,7 @@ NSC_IELT("uw", "u", sfx, base, I_UW), \
NSC_IELT("rad", "r", sfx, base, I_RAD) NSC_IELT("rad", "r", sfx, base, I_RAD)
struct castr ichr_ca[] = { struct castr ichr_ca[] = {
{NSC_SITYPE(i_type), 0, 0, offsetof(struct ichrstr, i_vtype), "vtype", {NSC_SITYPE(i_type), 0, 0, offsetof(struct ichrstr, i_uid), "uid",
EF_ITEM}, EF_ITEM},
{NSC_STRING, 0, 0, offsetof(struct ichrstr, i_name), "name", EF_BAD}, {NSC_STRING, 0, 0, offsetof(struct ichrstr, i_name), "name", EF_BAD},
{NSC_STRINGY, NSC_CONST, 1, offsetof(struct ichrstr, i_mnem), "mnem", {NSC_STRINGY, NSC_CONST, 1, offsetof(struct ichrstr, i_mnem), "mnem",

View file

@ -1272,13 +1272,13 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags,
case 't': case 't':
if ((pcp->pl_flags & P_C) == 0 || ip == 0) if ((pcp->pl_flags & P_C) == 0 || ip == 0)
break; break;
itype = ip->i_vtype; itype = ip->i_uid;
needed = (pp->pln_load * 2) / ip->i_lbs; needed = (pp->pln_load * 2) / ip->i_lbs;
break; break;
case 'd': case 'd':
if ((pcp->pl_flags & P_C) == 0 || ip == 0) if ((pcp->pl_flags & P_C) == 0 || ip == 0)
break; break;
itype = ip->i_vtype; itype = ip->i_uid;
needed = (pp->pln_load * 2) / ip->i_lbs; needed = (pp->pln_load * 2) / ip->i_lbs;
break; break;
case 'a': case 'a':

View file

@ -303,18 +303,18 @@ pln_dropoff(struct emp_qelem *list, struct ichrstr *ip, coord tx, coord ty,
xyas(tx, ty, player->cnum)); xyas(tx, ty, player->cnum));
return; return;
} }
if (ip->i_vtype == I_CIVIL && sectp->sct_own != sectp->sct_oldown) { if (ip->i_uid == I_CIVIL && sectp->sct_own != sectp->sct_oldown) {
pr("%s is occupied. Your civilians suffer from identity crisis and die.\n", pr("%s is occupied. Your civilians suffer from identity crisis and die.\n",
xyas(tx, ty, player->cnum)); xyas(tx, ty, player->cnum));
return; return;
} }
there = sectp->sct_item[ip->i_vtype]; there = sectp->sct_item[ip->i_uid];
max = ITEM_MAX; max = ITEM_MAX;
} else { } else {
sp = ptr; sp = ptr;
there = sp->shp_item[ip->i_vtype]; there = sp->shp_item[ip->i_uid];
mp = &mchr[(int)sp->shp_type]; mp = &mchr[(int)sp->shp_type];
max = mp->m_item[ip->i_vtype]; max = mp->m_item[ip->i_uid];
} }
there += amt; there += amt;
if (there > max) { if (there > max) {
@ -325,7 +325,7 @@ pln_dropoff(struct emp_qelem *list, struct ichrstr *ip, coord tx, coord ty,
pr("%d %s landed safely", amt, ip->i_name); pr("%d %s landed safely", amt, ip->i_name);
if (type == EF_SECTOR) { if (type == EF_SECTOR) {
sectp = ptr; sectp = ptr;
sectp->sct_item[ip->i_vtype] = there; sectp->sct_item[ip->i_uid] = there;
if (sectp->sct_own != player->cnum) if (sectp->sct_own != player->cnum)
wu(0, sectp->sct_own, "%s planes drop %d %s in %s\n", wu(0, sectp->sct_own, "%s planes drop %d %s in %s\n",
cname(player->cnum), amt, ip->i_name, cname(player->cnum), amt, ip->i_name,
@ -334,7 +334,7 @@ pln_dropoff(struct emp_qelem *list, struct ichrstr *ip, coord tx, coord ty,
putsect((struct sctstr *)ptr); putsect((struct sctstr *)ptr);
} else { } else {
struct shpstr *sp = (struct shpstr *)ptr; struct shpstr *sp = (struct shpstr *)ptr;
sp->shp_item[ip->i_vtype] = there; sp->shp_item[ip->i_uid] = there;
if (sp->shp_own != player->cnum) if (sp->shp_own != player->cnum)
wu(0, sp->shp_own, "%s planes land %d %s on carrier %d\n", wu(0, sp->shp_own, "%s planes land %d %s on carrier %d\n",
cname(player->cnum), amt, ip->i_name, sp->shp_uid); cname(player->cnum), amt, ip->i_name, sp->shp_uid);
@ -632,7 +632,7 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission)
own = sect.sct_oldown; own = sect.sct_oldown;
} }
if (ip) { if (ip) {
if (ip->i_vtype == I_CIVIL) { if (ip->i_uid == I_CIVIL) {
if (pp->pln_own != own) { if (pp->pln_own != own) {
pr("You don't control those civilians!\n"); pr("You don't control those civilians!\n");
return -1; return -1;
@ -660,7 +660,7 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission)
case 'd': case 'd':
if ((pcp->pl_flags & P_C) == 0 || ip == 0) if ((pcp->pl_flags & P_C) == 0 || ip == 0)
break; break;
itype = ip->i_vtype; itype = ip->i_uid;
needed = (pp->pln_load * 2) / ip->i_lbs; needed = (pp->pln_load * 2) / ip->i_lbs;
break; break;
case 'm': case 'm':

View file

@ -253,9 +253,9 @@ get_couval(int cnum)
secttot += (long)(dchr[sp->sct_type].d_value * secttot += (long)(dchr[sp->sct_type].d_value *
((float)sp->sct_effic + 100.0)); ((float)sp->sct_effic + 100.0));
for (k = 0; ichr[k].i_name; k++) { for (k = 0; ichr[k].i_name; k++) {
if (ichr[k].i_value == 0 || ichr[k].i_vtype == I_NONE) if (ichr[k].i_value == 0 || ichr[k].i_uid == I_NONE)
continue; continue;
val = sp->sct_item[ichr[k].i_vtype]; val = sp->sct_item[ichr[k].i_uid];
secttot += val * ichr[k].i_value; secttot += val * ichr[k].i_value;
} }
} }

View file

@ -80,7 +80,7 @@ deliver(struct sctstr *from, struct ichrstr *ip, int dir,
return 0; return 0;
} }
dp = &dchr[from->sct_type]; dp = &dchr[from->sct_type];
vtype = ip->i_vtype; vtype = ip->i_uid;
mobility = from->sct_mobil / 2; mobility = from->sct_mobil / 2;
if (vtype == I_CIVIL) { if (vtype == I_CIVIL) {
if (from->sct_own != from->sct_oldown) { if (from->sct_own != from->sct_oldown) {