]> git.pond.sub.org Git - empserver/commitdiff
(ichrstr): Rename member i_vtype to i_uid.
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 20 Feb 2006 05:35:58 +0000 (05:35 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 20 Feb 2006 05:35:58 +0000 (05:35 +0000)
(ichr_ca): Rename selector vtype to uid.

24 files changed:
include/item.h
src/lib/commands/bomb.c
src/lib/commands/buy.c
src/lib/commands/coll.c
src/lib/commands/deli.c
src/lib/commands/drop.c
src/lib/commands/expl.c
src/lib/commands/fly.c
src/lib/commands/give.c
src/lib/commands/load.c
src/lib/commands/lten.c
src/lib/commands/mark.c
src/lib/commands/move.c
src/lib/commands/orde.c
src/lib/commands/rout.c
src/lib/commands/sell.c
src/lib/commands/shoo.c
src/lib/commands/tend.c
src/lib/commands/thre.c
src/lib/global/nsc.c
src/lib/subs/mission.c
src/lib/subs/plnsub.c
src/lib/subs/trdsub.c
src/lib/update/deliver.c

index 65f22809161af04b5eba439cb2c2bbb9411618e5..fb40724bb82a6aaf13f145b1d2a89a6f57c29d07 100644 (file)
@@ -69,7 +69,7 @@ typedef enum {
 
 struct ichrstr {
     char i_mnem;               /* usually the initial letter */
 
 struct ichrstr {
     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_sell;                        /* can this be sold? */
     int i_lbs;                 /* how hard to move */
     int i_value;               /* mortgage value */
     int i_sell;                        /* can this be sold? */
     int i_lbs;                 /* how hard to move */
index ba456860793b79bc660b997cc86e8038cb6ff42c..92799b95185969fa374e684145e2883b546cf9d8 100644 (file)
@@ -449,8 +449,8 @@ comm_bomb(struct emp_qelem *list, struct sctstr *target)
        return;
     getsect(target->sct_x, target->sct_y, &sect);
     target = &sect;
        return;
     getsect(target->sct_x, target->sct_y, &sect);
     target = &sect;
-    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
     if (before > 0.0)
        b = 100.0 * (1.0 - ((float)amt / (float)before));
     else
index 219bdcc355548fe1f9bca0f050e4c9cd2f12dc1b..bc33836ccab03b74ec6fc2f8770ccde7b13f7400 100644 (file)
@@ -85,7 +85,7 @@ buy(void)
     ip = whatitem(player->argp[1], "Commodity you want to buy: ");
     if (!ip)
        return RET_SYN;
     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)
     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;
     }
        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;
     }
        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;
     }
        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",
     qty = comm.com_amount;
     if (qty + n > ITEM_MAX) {
        pr("That sector cannot hold %d more %s. It currently holds %d.\n",
index 57d22f46629a0077f84d7a112285875457279b1e..854eb7d78f6ab119424972ae1652959204f86a23 100644 (file)
@@ -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++) {
     }
     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;
            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);
        pay += val * ichr[i].i_value;
     }
     pr("That sector (and its contents) is valued at $%.2f\n", pay);
index 0426c530d1911c6c9ff1d88e960ef2e96884f990..fd1f86045cf958175d88d4dbf9ecfc7a0fa9ccd8 100644 (file)
@@ -60,7 +60,7 @@ deli(void)
     if ((ich = whatitem(player->argp[1], "deliver what? ")) == 0)
        return RET_SYN;
     /*
     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;
        }
        pr("You cannot deliver people!\n");
        return RET_FAIL;
        }
@@ -72,7 +72,7 @@ deli(void)
        if (!player->owner)
            continue;
 
        if (!player->owner)
            continue;
 
-       del = sect.sct_del[ich->i_vtype];
+       del = sect.sct_del[ich->i_uid];
        thresh = del & ~0x7;
        dir = del & 0x7;
 
        thresh = del & ~0x7;
        dir = del & 0x7;
 
@@ -107,7 +107,7 @@ deli(void)
 
            thresh = MIN(thresh, ITEM_MAX) & ~7;
            del = thresh | dir;
 
            thresh = MIN(thresh, ITEM_MAX) & ~7;
            del = thresh | dir;
-           sect.sct_del[ich->i_vtype] = del;
+           sect.sct_del[ich->i_uid] = del;
            putsect(&sect);
        }
 
            putsect(&sect);
        }
 
index de48984e86734504136448d9830c7ee6216c2d9e..924a11ae7a00529e63d91ef22418aed19eee7dd8 100644 (file)
@@ -87,13 +87,13 @@ drop(void)
 
     if (target.sct_own == player->cnum
        || getrel(getnatp(target.sct_own), player->cnum) == ALLIED) {
 
     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... */
            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;
        }
            pr("You don't own %s!\n", xyas(tx, ty, player->cnum));
            return RET_FAIL;
        }
index b2a42cbb0b266fdba38eb811ac64efc541e16c5a..cae8cc79b32b3428fff3413d3d2b8488e45a8e5e 100644 (file)
@@ -75,7 +75,7 @@ explore(void)
 
     if (!(ip = whatitem(player->argp[1], "explore with what? (civ/mil) ")))
        return RET_SYN;
 
     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;
     if ((vtype != I_CIVIL) && (vtype != I_MILIT)) {
        pr("You can only explore with civs and mil.\n");
        return RET_FAIL;
index a59323c7aca890a1fe46e9890c9b2f089eba47e8..a7e0db4010d6bb841d54132682827f756ac0110b 100644 (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");
        return RET_FAIL;
     }
        pr("Can't fly civilians into occupied sectors.\n");
        return RET_FAIL;
     }
index 682a72f9214d221e89d2cc1106fcf1e4d5daf100..cc9b4b366dc91763da312aaa6567f31b482918ae 100644 (file)
@@ -70,14 +70,14 @@ give(void)
            return RET_SYN;
        if ((amt = atoi(p)) == 0)
            return RET_SYN;
            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;
        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(&sect);
        if (sect.sct_own != 0 && m != n) {
            if (m > n) {
        putsect(&sect);
        if (sect.sct_own != 0 && m != n) {
            if (m > n) {
index 998d86b9414d3e899246a1045a99f6cb2f4be64b..015b0836357c0fdf7a4701f5c3cd51a4be6eba83 100644 (file)
@@ -725,7 +725,7 @@ static int
 load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
               struct ichrstr *ich, int load_unload, int *nshipsp)
 {
 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;
     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)
 {
 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;
     struct lchrstr *lcp = &lchr[(int)lp->lnd_type];
     int land_amt, land_max, sect_amt, move_amt;
     int amount;
index 16e75217b1030fe0bc187087e63a1b5eee77f9a3..7e338e17cd61a7ccd4c7f516d1bf3930eee7ee67 100644 (file)
@@ -86,13 +86,13 @@ ltend(void)
            return RET_FAIL;
        if ((amt = atoi(p)) == 0)
            break;
            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];
        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);
        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;
 
            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];
            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;
            if (amt < 0) {
                if (!player->owner)
                    amt = 0;
@@ -128,7 +128,7 @@ ltend(void)
                transfer = MIN(maxtender - ontender, transfer);
                if (transfer == 0)
                    continue;
                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 {
                ontender += transfer;
                total += transfer;
            } else {
@@ -137,7 +137,7 @@ ltend(void)
                transfer = MIN(transfer, maxtarget - ontarget);
                if (transfer == 0)
                    continue;
                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;
            }
                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));
        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);
     }
        tender.shp_mission = 0;
        putship(tender.shp_uid, &tender);
     }
index a28c2e146f40e9a4655d038435b62b99c495bd0a..e98b7800b3a1997c6ea9ee8aed7c29919ee3b394 100644 (file)
@@ -65,7 +65,7 @@ mark(void)
            ip = item_by_name(p);
            if (!ip)
                return RET_SYN;
            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);
        }
     }
     return display_mark(I_NONE, 1);
index 3b6d9991ed399e4a7d9f3cd797d822e96c441b54..b231c1ae02f28bcc0b4d2da8d04f2c0b0130b9df 100644 (file)
@@ -80,7 +80,7 @@ move(void)
     istest = *player->argp[0] == 't';
     if ((ip = whatitem(player->argp[1], "move what? ")) == 0)
        return RET_SYN;
     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))
     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) {
                        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"
        if (left < amount) {
            if (left) {
                pr("%d of the %s you were moving were destroyed!\n"
index 182fa8f9f955a026be0a065d1cccaea9f757859f..3cd98a5d1d77c8ccdca6bccb28d960be9ab995da 100644 (file)
@@ -233,7 +233,7 @@ orde(void)
                            level = 0;  /* prevent negatives. */
                            pr("You must use positive number! Level set to 0.\n");
                        }
                            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;
                        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");
                        }
                            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;
                        ship.shp_lend[sub] = level;
                        pr("Order Set \n");
                        break;
index 251e03d15c5d6161bce2789556fdd2081fd0878f..7295226ef6ecc156319fdbb01d79df6fa4ba8762 100644 (file)
@@ -74,7 +74,7 @@ rout(void)
 
     if ((ip = whatitem(player->argp[1], "What item? ")) == 0)
        return RET_SYN;
 
     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;
     if (player->argp[2] == NULL) {
        if ((str = getstring("(sects)? ", buf1)) == 0)
            return RET_SYN;
index 524bd3a7e8e439f4fe4c86ff7729b350454087a3..ebb375d0bde9ee4497f76c980874380e5648cc2d 100644 (file)
@@ -131,7 +131,7 @@ sell(void)
        pr("Military control required to sell goods.\n");
        return RET_FAIL;
     }
        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;
     }
        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);
     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(&sect);
     if (totalcom > 0) {
        for (ii = 0; getcomm(ii, &comm); ii++) {
     putsect(&sect);
     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);
        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;
        comm.com_owner = player->cnum;
        comm.com_price = price;
        comm.com_maxbidder = player->cnum;
index df9634335b0920cdca7443d3a67c1a6ee67f3f91..eaef97d7ed37d564291805ee4323fc540d611cda 100644 (file)
@@ -65,9 +65,9 @@ shoo(void)
     char buf[1024];
 
     ip = whatitem(player->argp[1], "Shoot what <civ or uw> ");
     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;
        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);
     if (!snxtsct(&nstr, player->argp[2]))
        return RET_SYN;
     sprintf(prompt, "number of %s to shoot? ", ip->i_name);
index 4771d1e7570c881ac9fa5fb3854e639263a86e94..dfdb6eaddab6d7c07da8ce4345f84f1f20482f73 100644 (file)
@@ -116,13 +116,13 @@ tend(void)
            pr("Amount must be non-zero!\n");
            return RET_SYN;
        }
            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];
        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);
        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;
            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];
            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;
            if (amt < 0) {
                if (!player->owner)
                    amt = 0;
@@ -160,7 +160,7 @@ tend(void)
                transfer = MIN(maxtender - ontender, transfer);
                if (transfer == 0)
                    continue;
                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 {
                ontender += transfer;
                total += transfer;
            } else {
@@ -169,7 +169,7 @@ tend(void)
                transfer = MIN(transfer, maxtarget - ontarget);
                if (transfer == 0)
                    continue;
                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;
            }
                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));
        }
            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);
     }
        tender.shp_mission = 0;
        putship(tender.shp_uid, &tender);
     }
index 80a03e84ec237b4503bf61d9314a7e0205ca6293..dd79ecae308890a7a6fa5c6da4f3e32829c8593a 100644 (file)
@@ -64,7 +64,7 @@ thre(void)
        return RET_SYN;
     if (!snxtsct(&nstr, player->argp[2]))
        return RET_SYN;
        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");
     if (player->argp[3] && *player->argp[3] &&
        (*player->argp[3] < '0' || *player->argp[3] > '9')) {
        pr("Threshold must be a number\n");
index fb99a8266b8f70924f763edca107b9a44bfe2fd5..9f71ea68c25f83c40c7f509a661993a1b7922cb8 100644 (file)
@@ -83,7 +83,7 @@ NSC_IELT("uw", "u", sfx, base, I_UW),         \
 NSC_IELT("rad", "r", sfx, base, I_RAD)
 
 struct castr ichr_ca[] = {
 NSC_IELT("rad", "r", sfx, base, I_RAD)
 
 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},
     {NSC_STRING, 0, 0, offsetof(struct ichrstr, i_name), "name", EF_BAD},
     {NSC_STRINGY, NSC_CONST, 1, offsetof(struct ichrstr, i_mnem), "mnem",
      EF_ITEM},
     {NSC_STRING, 0, 0, offsetof(struct ichrstr, i_name), "name", EF_BAD},
     {NSC_STRINGY, NSC_CONST, 1, offsetof(struct ichrstr, i_mnem), "mnem",
index 5f8ccbc2264ef1add14b78f243bdee4b2e71a342..22e0ddbd7a55359bb9ba2de3b8381e0e583c8c9a 100644 (file)
@@ -1272,13 +1272,13 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags,
        case 't':
            if ((pcp->pl_flags & P_C) == 0 || ip == 0)
                break;
        case 't':
            if ((pcp->pl_flags & P_C) == 0 || ip == 0)
                break;
-           itype = ip->i_vtype;
+           itype = ip->i_uid;
            needed = (pp->pln_load * 2) / ip->i_lbs;
            break;
        case 'd':
            if ((pcp->pl_flags & P_C) == 0 || ip == 0)
                break;
            needed = (pp->pln_load * 2) / ip->i_lbs;
            break;
        case 'd':
            if ((pcp->pl_flags & P_C) == 0 || ip == 0)
                break;
-           itype = ip->i_vtype;
+           itype = ip->i_uid;
            needed = (pp->pln_load * 2) / ip->i_lbs;
            break;
        case 'a':
            needed = (pp->pln_load * 2) / ip->i_lbs;
            break;
        case 'a':
index 1c56c5acf419ab2242feee43db4e0200da250bcd..8bccf936e6a5b762650fb2c0b0778205ad0993c4 100644 (file)
@@ -303,18 +303,18 @@ pln_dropoff(struct emp_qelem *list, struct ichrstr *ip, coord tx, coord ty,
               xyas(tx, ty, player->cnum));
            return;
        }
               xyas(tx, ty, player->cnum));
            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",
               xyas(tx, ty, player->cnum));
            return;
        }
            pr("%s is occupied.  Your civilians suffer from identity crisis and die.\n",
               xyas(tx, ty, player->cnum));
            return;
        }
-       there = sectp->sct_item[ip->i_vtype];
+       there = sectp->sct_item[ip->i_uid];
        max = ITEM_MAX;
     } else {
        sp = ptr;
        max = ITEM_MAX;
     } else {
        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;
     if (there > max) {
     }
     there += amt;
     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);
     if (type == EF_SECTOR) {
        sectp = ptr;
     pr("%d %s landed safely", amt, ip->i_name);
     if (type == EF_SECTOR) {
        sectp = ptr;
-       sectp->sct_item[ip->i_vtype] = there;
+       sectp->sct_item[ip->i_uid] = there;
        if (sectp->sct_own != player->cnum)
            wu(0, sectp->sct_own, "%s planes drop %d %s in %s\n",
               cname(player->cnum), amt, ip->i_name,
        if (sectp->sct_own != player->cnum)
            wu(0, sectp->sct_own, "%s planes drop %d %s in %s\n",
               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);
     } else {
        struct shpstr *sp = (struct shpstr *)ptr;
        putsect((struct sctstr *)ptr);
     } else {
        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)
            wu(0, sp->shp_own, "%s planes land %d %s on carrier %d\n",
               cname(player->cnum), amt, ip->i_name, sp->shp_uid);
        if (sp->shp_own != player->cnum)
            wu(0, sp->shp_own, "%s planes land %d %s on carrier %d\n",
               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;
     }
     if (ip) {
        own = sect.sct_oldown;
     }
     if (ip) {
-       if (ip->i_vtype == I_CIVIL) {
+       if (ip->i_uid == I_CIVIL) {
            if (pp->pln_own != own) {
                pr("You don't control those civilians!\n");
                return -1;
            if (pp->pln_own != own) {
                pr("You don't control those civilians!\n");
                return -1;
@@ -660,7 +660,7 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission)
        case 'd':
            if ((pcp->pl_flags & P_C) == 0 || ip == 0)
                break;
        case 'd':
            if ((pcp->pl_flags & P_C) == 0 || ip == 0)
                break;
-           itype = ip->i_vtype;
+           itype = ip->i_uid;
            needed = (pp->pln_load * 2) / ip->i_lbs;
            break;
        case 'm':
            needed = (pp->pln_load * 2) / ip->i_lbs;
            break;
        case 'm':
index 9a7542d77dea0d19daf6ac5623479ebebdc12617..b6a8fe538bba62de56ca1bb25db09a419e558608 100644 (file)
@@ -253,9 +253,9 @@ get_couval(int cnum)
        secttot += (long)(dchr[sp->sct_type].d_value *
                          ((float)sp->sct_effic + 100.0));
        for (k = 0; ichr[k].i_name; k++) {
        secttot += (long)(dchr[sp->sct_type].d_value *
                          ((float)sp->sct_effic + 100.0));
        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;
        }
     }
index 0ea7dc045f2fc3c2ca447faa130885886382eb8e..555e0f879e63fff66769c54450585729a7e54179 100644 (file)
@@ -80,7 +80,7 @@ deliver(struct sctstr *from, struct ichrstr *ip, int dir,
        return 0;
     }
     dp = &dchr[from->sct_type];
        return 0;
     }
     dp = &dchr[from->sct_type];
-    vtype = ip->i_vtype;
+    vtype = ip->i_uid;
     mobility = from->sct_mobil / 2;
     if (vtype == I_CIVIL) {
        if (from->sct_own != from->sct_oldown) {
     mobility = from->sct_mobil / 2;
     if (vtype == I_CIVIL) {
        if (from->sct_own != from->sct_oldown) {