(ichrstr): Rename member i_vtype to i_uid.
(ichr_ca): Rename selector vtype to uid.
This commit is contained in:
parent
96a1e8277a
commit
783b00bbad
24 changed files with 59 additions and 59 deletions
|
@ -449,8 +449,8 @@ comm_bomb(struct emp_qelem *list, struct sctstr *target)
|
|||
return;
|
||||
getsect(target->sct_x, target->sct_y, §);
|
||||
target = §
|
||||
before = amt = target->sct_item[ip->i_vtype];
|
||||
target->sct_item[ip->i_vtype] = amt = commdamage(amt, dam, ip->i_vtype);
|
||||
before = amt = target->sct_item[ip->i_uid];
|
||||
target->sct_item[ip->i_uid] = amt = commdamage(amt, dam, ip->i_uid);
|
||||
if (before > 0.0)
|
||||
b = 100.0 * (1.0 - ((float)amt / (float)before));
|
||||
else
|
||||
|
|
|
@ -85,7 +85,7 @@ buy(void)
|
|||
ip = whatitem(player->argp[1], "Commodity you want to buy: ");
|
||||
if (!ip)
|
||||
return RET_SYN;
|
||||
display_mark(ip->i_vtype, 0);
|
||||
display_mark(ip->i_uid, 0);
|
||||
pr("\n");
|
||||
p = getstarg(player->argp[2], "Which lot are you bidding on: ", buf);
|
||||
if (p == 0)
|
||||
|
@ -99,7 +99,7 @@ buy(void)
|
|||
pr("Invalid lot number.\n");
|
||||
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");
|
||||
return RET_OK;
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ buy(void)
|
|||
pr("That sector is under construction.\n");
|
||||
return RET_FAIL;
|
||||
}
|
||||
n = sect.sct_item[ip->i_vtype];
|
||||
n = sect.sct_item[ip->i_uid];
|
||||
qty = comm.com_amount;
|
||||
if (qty + n > ITEM_MAX) {
|
||||
pr("That sector cannot hold %d more %s. It currently holds %d.\n",
|
||||
|
|
|
@ -101,9 +101,9 @@ coll(void)
|
|||
}
|
||||
pay = dchr[sect.sct_type].d_value * ((float)sect.sct_effic + 100.0);
|
||||
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;
|
||||
val = sect.sct_item[ichr[i].i_vtype];
|
||||
val = sect.sct_item[ichr[i].i_uid];
|
||||
pay += val * ichr[i].i_value;
|
||||
}
|
||||
pr("That sector (and its contents) is valued at $%.2f\n", pay);
|
||||
|
|
|
@ -60,7 +60,7 @@ deli(void)
|
|||
if ((ich = whatitem(player->argp[1], "deliver what? ")) == 0)
|
||||
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");
|
||||
return RET_FAIL;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ deli(void)
|
|||
if (!player->owner)
|
||||
continue;
|
||||
|
||||
del = sect.sct_del[ich->i_vtype];
|
||||
del = sect.sct_del[ich->i_uid];
|
||||
thresh = del & ~0x7;
|
||||
dir = del & 0x7;
|
||||
|
||||
|
@ -107,7 +107,7 @@ deli(void)
|
|||
|
||||
thresh = MIN(thresh, ITEM_MAX) & ~7;
|
||||
del = thresh | dir;
|
||||
sect.sct_del[ich->i_vtype] = del;
|
||||
sect.sct_del[ich->i_uid] = del;
|
||||
putsect(§);
|
||||
}
|
||||
|
||||
|
|
|
@ -87,13 +87,13 @@ drop(void)
|
|||
|
||||
if (target.sct_own == player->cnum
|
||||
|| 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");
|
||||
return RET_FAIL;
|
||||
}
|
||||
} else {
|
||||
/* 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));
|
||||
return RET_FAIL;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ explore(void)
|
|||
|
||||
if (!(ip = whatitem(player->argp[1], "explore with what? (civ/mil) ")))
|
||||
return RET_SYN;
|
||||
vtype = ip->i_vtype;
|
||||
vtype = ip->i_uid;
|
||||
if ((vtype != I_CIVIL) && (vtype != I_MILIT)) {
|
||||
pr("You can only explore with civs and mil.\n");
|
||||
return RET_FAIL;
|
||||
|
|
|
@ -103,7 +103,7 @@ fly(void)
|
|||
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");
|
||||
return RET_FAIL;
|
||||
}
|
||||
|
|
|
@ -70,14 +70,14 @@ give(void)
|
|||
return RET_SYN;
|
||||
if ((amt = atoi(p)) == 0)
|
||||
return RET_SYN;
|
||||
n = sect.sct_item[ip->i_vtype];
|
||||
n = sect.sct_item[ip->i_uid];
|
||||
if (amt < 0 && -amt > n) {
|
||||
m = 0;
|
||||
} else if (amt > 0 && amt + n > ITEM_MAX) {
|
||||
m = ITEM_MAX;
|
||||
} else
|
||||
m = n + amt;
|
||||
sect.sct_item[ip->i_vtype] = m;
|
||||
sect.sct_item[ip->i_uid] = m;
|
||||
putsect(§);
|
||||
if (sect.sct_own != 0 && m != n) {
|
||||
if (m > n) {
|
||||
|
|
|
@ -725,7 +725,7 @@ static int
|
|||
load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
|
||||
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];
|
||||
int ship_amt, ship_max, sect_amt, move_amt;
|
||||
int amount;
|
||||
|
@ -928,7 +928,7 @@ static int
|
|||
load_comm_land(struct sctstr *sectp, struct lndstr *lp,
|
||||
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];
|
||||
int land_amt, land_max, sect_amt, move_amt;
|
||||
int amount;
|
||||
|
|
|
@ -86,13 +86,13 @@ ltend(void)
|
|||
return RET_FAIL;
|
||||
if ((amt = atoi(p)) == 0)
|
||||
break;
|
||||
ontender = tender.shp_item[ip->i_vtype];
|
||||
ontender = tender.shp_item[ip->i_uid];
|
||||
if (ontender == 0 && amt > 0) {
|
||||
pr("No %s on %s\n", ip->i_name, prship(&tender));
|
||||
return RET_FAIL;
|
||||
}
|
||||
vbase = &mchr[(int)tender.shp_type];
|
||||
maxtender = vbase->m_item[ip->i_vtype];
|
||||
maxtender = vbase->m_item[ip->i_uid];
|
||||
if (maxtender == 0) {
|
||||
pr("A %s cannot hold any %s\n",
|
||||
mchr[(int)tender.shp_type].m_name, ip->i_name);
|
||||
|
@ -111,14 +111,14 @@ ltend(void)
|
|||
|
||||
if (target.lnd_ship != tender.shp_uid)
|
||||
continue;
|
||||
ontarget = target.lnd_item[ip->i_vtype];
|
||||
ontarget = target.lnd_item[ip->i_uid];
|
||||
if (ontarget == 0 && amt < 0) {
|
||||
pr("No %s on %s\n",
|
||||
ip->i_name, prland(&target));
|
||||
continue;
|
||||
}
|
||||
lbase = &lchr[(int)target.lnd_type];
|
||||
maxtarget = lbase->l_item[ip->i_vtype];
|
||||
maxtarget = lbase->l_item[ip->i_uid];
|
||||
if (amt < 0) {
|
||||
if (!player->owner)
|
||||
amt = 0;
|
||||
|
@ -128,7 +128,7 @@ ltend(void)
|
|||
transfer = MIN(maxtender - ontender, transfer);
|
||||
if (transfer == 0)
|
||||
continue;
|
||||
target.lnd_item[ip->i_vtype] = ontarget - transfer;
|
||||
target.lnd_item[ip->i_uid] = ontarget - transfer;
|
||||
ontender += transfer;
|
||||
total += transfer;
|
||||
} else {
|
||||
|
@ -137,7 +137,7 @@ ltend(void)
|
|||
transfer = MIN(transfer, maxtarget - ontarget);
|
||||
if (transfer == 0)
|
||||
continue;
|
||||
target.lnd_item[ip->i_vtype] = ontarget + transfer;
|
||||
target.lnd_item[ip->i_uid] = ontarget + transfer;
|
||||
ontender -= transfer;
|
||||
total += transfer;
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ ltend(void)
|
|||
pr("%d total %s transferred %s %s\n",
|
||||
total, ip->i_name, (amt > 0) ? "off of" : "to",
|
||||
prship(&tender));
|
||||
tender.shp_item[ip->i_vtype] = ontender;
|
||||
tender.shp_item[ip->i_uid] = ontender;
|
||||
tender.shp_mission = 0;
|
||||
putship(tender.shp_uid, &tender);
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ mark(void)
|
|||
ip = item_by_name(p);
|
||||
if (!ip)
|
||||
return RET_SYN;
|
||||
return display_mark(ip->i_vtype, 0);
|
||||
return display_mark(ip->i_uid, 0);
|
||||
}
|
||||
}
|
||||
return display_mark(I_NONE, 1);
|
||||
|
|
|
@ -80,7 +80,7 @@ move(void)
|
|||
istest = *player->argp[0] == 't';
|
||||
if ((ip = whatitem(player->argp[1], "move what? ")) == 0)
|
||||
return RET_SYN;
|
||||
vtype = ip->i_vtype;
|
||||
vtype = ip->i_uid;
|
||||
if (!(p = getstarg(player->argp[2], "from sector : ", buf)))
|
||||
return RET_SYN;
|
||||
if (!sarg_xy(p, &x, &y))
|
||||
|
@ -193,7 +193,7 @@ move(void)
|
|||
cmd_move_map, 0, &dam);
|
||||
|
||||
if (dam) {
|
||||
left = commdamage(amount, dam, ip->i_vtype);
|
||||
left = commdamage(amount, dam, ip->i_uid);
|
||||
if (left < amount) {
|
||||
if (left) {
|
||||
pr("%d of the %s you were moving were destroyed!\n"
|
||||
|
|
|
@ -233,7 +233,7 @@ orde(void)
|
|||
level = 0; /* prevent negatives. */
|
||||
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;
|
||||
pr("Order Set \n");
|
||||
break;
|
||||
|
@ -253,7 +253,7 @@ orde(void)
|
|||
level = 0;
|
||||
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;
|
||||
pr("Order Set \n");
|
||||
break;
|
||||
|
|
|
@ -74,7 +74,7 @@ rout(void)
|
|||
|
||||
if ((ip = whatitem(player->argp[1], "What item? ")) == 0)
|
||||
return RET_SYN;
|
||||
i_del = ip->i_vtype;;
|
||||
i_del = ip->i_uid;;
|
||||
if (player->argp[2] == NULL) {
|
||||
if ((str = getstring("(sects)? ", buf1)) == 0)
|
||||
return RET_SYN;
|
||||
|
|
|
@ -131,7 +131,7 @@ sell(void)
|
|||
pr("Military control required to sell goods.\n");
|
||||
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);
|
||||
return RET_FAIL;
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ sell(void)
|
|||
amt -= com;
|
||||
pr("Sold %d %s at %s (%d left)\n", com, ip->i_name,
|
||||
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(§);
|
||||
if (totalcom > 0) {
|
||||
for (ii = 0; getcomm(ii, &comm); ii++) {
|
||||
|
@ -155,7 +155,7 @@ sell(void)
|
|||
if (getcomm(ii, &comm) == 0)
|
||||
ef_extend(EF_COMM, 1);
|
||||
(void)time(&now);
|
||||
comm.com_type = ip->i_vtype;
|
||||
comm.com_type = ip->i_uid;
|
||||
comm.com_owner = player->cnum;
|
||||
comm.com_price = price;
|
||||
comm.com_maxbidder = player->cnum;
|
||||
|
|
|
@ -65,9 +65,9 @@ shoo(void)
|
|||
char buf[1024];
|
||||
|
||||
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;
|
||||
item = ip->i_vtype;
|
||||
item = ip->i_uid;
|
||||
if (!snxtsct(&nstr, player->argp[2]))
|
||||
return RET_SYN;
|
||||
sprintf(prompt, "number of %s to shoot? ", ip->i_name);
|
||||
|
|
|
@ -116,13 +116,13 @@ tend(void)
|
|||
pr("Amount must be non-zero!\n");
|
||||
return RET_SYN;
|
||||
}
|
||||
ontender = tender.shp_item[ip->i_vtype];
|
||||
ontender = tender.shp_item[ip->i_uid];
|
||||
if (ontender == 0 && amt > 0) {
|
||||
pr("No %s on %s\n", ip->i_name, prship(&tender));
|
||||
return RET_FAIL;
|
||||
}
|
||||
vbase = &mchr[(int)tender.shp_type];
|
||||
maxtender = vbase->m_item[ip->i_vtype];
|
||||
maxtender = vbase->m_item[ip->i_uid];
|
||||
if (maxtender == 0) {
|
||||
pr("A %s cannot hold any %s\n",
|
||||
mchr[(int)tender.shp_type].m_name, ip->i_name);
|
||||
|
@ -144,13 +144,13 @@ tend(void)
|
|||
if (tender.shp_x != target.shp_x ||
|
||||
tender.shp_y != target.shp_y)
|
||||
continue;
|
||||
ontarget = target.shp_item[ip->i_vtype];
|
||||
ontarget = target.shp_item[ip->i_uid];
|
||||
if (ontarget == 0 && amt < 0) {
|
||||
pr("No %s on %s\n", ip->i_name, prship(&target));
|
||||
continue;
|
||||
}
|
||||
vbase = &mchr[(int)target.shp_type];
|
||||
maxtarget = vbase->m_item[ip->i_vtype];
|
||||
maxtarget = vbase->m_item[ip->i_uid];
|
||||
if (amt < 0) {
|
||||
if (!player->owner)
|
||||
amt = 0;
|
||||
|
@ -160,7 +160,7 @@ tend(void)
|
|||
transfer = MIN(maxtender - ontender, transfer);
|
||||
if (transfer == 0)
|
||||
continue;
|
||||
target.shp_item[ip->i_vtype] = ontarget - transfer;
|
||||
target.shp_item[ip->i_uid] = ontarget - transfer;
|
||||
ontender += transfer;
|
||||
total += transfer;
|
||||
} else {
|
||||
|
@ -169,7 +169,7 @@ tend(void)
|
|||
transfer = MIN(transfer, maxtarget - ontarget);
|
||||
if (transfer == 0)
|
||||
continue;
|
||||
target.shp_item[ip->i_vtype] = ontarget + transfer;
|
||||
target.shp_item[ip->i_uid] = ontarget + transfer;
|
||||
ontender -= transfer;
|
||||
total += transfer;
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ tend(void)
|
|||
wu(0, target.shp_own, "%s tended %d %s to %s\n",
|
||||
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;
|
||||
putship(tender.shp_uid, &tender);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ thre(void)
|
|||
return RET_SYN;
|
||||
if (!snxtsct(&nstr, player->argp[2]))
|
||||
return RET_SYN;
|
||||
type = ip->i_vtype;
|
||||
type = ip->i_uid;
|
||||
if (player->argp[3] && *player->argp[3] &&
|
||||
(*player->argp[3] < '0' || *player->argp[3] > '9')) {
|
||||
pr("Threshold must be a number\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue