]> git.pond.sub.org Git - empserver/commitdiff
(carg, lcarg, fort, land, ldump, lsta, orde, payo, retr, lretr)
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Nov 2005 20:54:59 +0000 (20:54 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Nov 2005 20:54:59 +0000 (20:54 +0000)
(cmd_sail_ship, cmd_unsail_ship, show_sail, sdump, shi, sstat, work):
Remove inappropriate ship/land sanity checks; should be done
elsewhere.

13 files changed:
src/lib/commands/carg.c
src/lib/commands/fort.c
src/lib/commands/land.c
src/lib/commands/ldump.c
src/lib/commands/lstat.c
src/lib/commands/orde.c
src/lib/commands/payo.c
src/lib/commands/retr.c
src/lib/commands/sail.c
src/lib/commands/sdump.c
src/lib/commands/shi.c
src/lib/commands/sstat.c
src/lib/commands/work.c

index 25b01b40b0f1d386f846c2dbb37d056801910294..043e9b323591a7569b4603271342d43455801025 100644 (file)
@@ -56,10 +56,6 @@ carg(void)
            continue;
        if ((player->cnum != ship.shp_own) && !player->god)
            continue;
-       if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
-           pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
-           continue;
-       }
        if (nships++ == 0)
            pr("shp# ship type           x,y   flt  eff  sh gun pet irn dst bar oil lcm hcm rad\n");
        pr("%4d ", ni.cur);
@@ -106,10 +102,6 @@ lcarg(void)
            continue;
        if ((player->cnum != land.lnd_own) && !player->god)
            continue;
-       if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
-           pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
-           continue;
-       }
        if (nunits++ == 0)
            pr("lnd# unit type           x,y    a   eff  sh gun pet irn dst bar oil lcm hcm rad\n");
        pr("%4d ", ni.cur);
index 433b4ba815cd8482e227ea582b41d45a11c0f295..6db2d2dc659031773a87fc968e7d0803d4c1ed9f 100644 (file)
@@ -62,11 +62,6 @@ fort(void)
     while (nxtitem(&ni, &land)) {
        if (!player->owner || land.lnd_own == 0)
            continue;
-       if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
-           pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
-           continue;
-       }
-
        getland(land.lnd_uid, &land);
        if (land.lnd_mobil < 0)
            continue;
index 5469c3ca86fe0423b310d7cee75762c0757ce898..8907e0b670743abe70cddeaffa607d2682b851bf 100644 (file)
@@ -56,10 +56,6 @@ land(void)
            continue;
        if (!player->owner && !player->god)
            continue;
-       if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
-           pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
-           continue;
-       }
        count_land_planes(&land);
        lnd_count_units(&land);
 
index 61466920b89ea13218b03f262d4c56788aa213f9..78288ee0fb09f4f122524ec567a4a7924edeea0b 100644 (file)
@@ -294,10 +294,6 @@ ldump(void)
            continue;
        if (!player->owner && !player->god)
            continue;
-       if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
-           pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
-           continue;
-       }
        count_land_planes(&land);
        lnd_count_units(&land);
 
index b18c663021235a2605ca8cc92519be93f8bf3119..5a0ff3e6bcac62c490e25f5a5be53cfe2d5cfd52 100644 (file)
@@ -52,10 +52,6 @@ lsta(void)
     while (nxtitem(&ni, &land)) {
        if (!player->owner || land.lnd_own == 0)
            continue;
-       if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
-           pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
-           continue;
-       }
        count_land_planes(&land);
 
        if (nunits++ == 0) {
index c21273625f81d03d51f243d2ac5bd7b9066b8b27..fc980e60f4f324b99a62ebdc7d047b5d1128618a 100644 (file)
@@ -86,10 +86,6 @@ orde(void)
     while (!player->aborted && nxtitem(&nb, (&ship))) {
        if (!player->owner || ship.shp_own == 0)
            continue;
-       if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
-           pr("bad ship type %d (#%d)\n", ship.shp_type, nb.cur);
-           continue;
-       }
        if (opt_SAIL) {
            if (*ship.shp_path) {
                if (!diffeachship)
index b73a16b3325fb183fee971f41ffbda3dce9153b5..511472f404ee1c503d737ededa7698caf237ae68 100644 (file)
@@ -64,10 +64,6 @@ payo(void)
     while (nxtitem(&ni, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
-       if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
-           pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
-           continue;
-       }
        mp = &mchr[(int)ship.shp_type];
 
        if (!(mp->m_flags & M_TRADE))
index e6837393a10e218da663a71e74ce06129e923690..4206ab8e1644adee37b3004b97073351fc67d723 100644 (file)
@@ -137,10 +137,6 @@ retr(void)
     while (nxtitem(&ni, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
-       if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
-           pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
-           continue;
-       }
        if (zero)
            memset(ship.shp_rpath, 0, sizeof(ship.shp_rpath));
 
@@ -268,10 +264,6 @@ lretr(void)
     while (nxtitem(&ni, &land)) {
        if (!player->owner || land.lnd_own == 0)
            continue;
-       if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
-           pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
-           continue;
-       }
        if (zero)
            memset(land.lnd_rpath, 0, sizeof(land.lnd_rpath));
 
index 4d63382749aab195e3e9490bcbfc5927eed4ec88..ce95ab5d8ac550961b593eae359e3a2416053b0f 100644 (file)
@@ -51,10 +51,6 @@ show_sail(struct nstr_item *nstr)
     while (nxtitem(nstr, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
-       if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
-           pr("bad ship type %d (#%d)\n", ship.shp_type, nstr->cur);
-           continue;
-       }
        if (count++ == 0) {
            if (player->god)
                pr("own ");
@@ -101,10 +97,6 @@ cmd_unsail_ship(struct nstr_item *nstr)
     while (nxtitem(nstr, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
-       if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
-           pr("bad ship type %d (#%d)\n", ship.shp_type, nstr->cur);
-           continue;
-       }
        if (ship.shp_path[0]) {
            pr("Ship #%d unsailed\n", ship.shp_uid);
            count++;
@@ -125,10 +117,6 @@ cmd_sail_ship(struct nstr_item *nstr)
     while (!player->aborted && nxtitem(nstr, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
-       if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
-           pr("bad ship type %d (#%d)\n", ship.shp_type, nstr->cur);
-           continue;
-       }
        if ((ship.shp_autonav & AN_AUTONAV) &&
            !(ship.shp_autonav & AN_STANDBY)) {
            pr("Ship #%d has other orders!\n", ship.shp_uid);
index 56ac3647eb5d3f09407068db347978a24452fd55..6051b490d9e9484586ad9ceb1a1ab9d9192f4fe6 100644 (file)
@@ -267,10 +267,6 @@ sdump(void)
     while (nxtitem(&ni, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
-       if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
-           pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
-           continue;
-       }
        count_planes(&ship);
        count_units(&ship);
        nships++;
index 505a34b45fd984bab9a7097d269a31f6c8f5b7a2..c99bca3e9f60475018a36cbbc7b9407fc200da14 100644 (file)
@@ -55,10 +55,6 @@ shi(void)
     while (nxtitem(&ni, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
-       if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
-           pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
-           continue;
-       }
        count_planes(&ship);
        count_units(&ship);
        if (nships++ == 0) {
index 48343ab69f31c87c288daaa1b2e322990e51c629..1433e86ca5740bddbf9d0943721dd903022a3e2a 100644 (file)
@@ -52,10 +52,6 @@ sstat(void)
     while (nxtitem(&ni, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
-       if (ship.shp_type < 0 || ship.shp_type > shp_maxno) {
-           pr("bad ship type %d (#%d)\n", ship.shp_type, ni.cur);
-           continue;
-       }
        count_planes(&ship);
        count_units(&ship);
 
index 0fa4d57b5a9296fcda812b56810cf2b9f391526d..de327c5989e1f0fef38fa98f52707dddd75d5096 100644 (file)
@@ -70,10 +70,6 @@ work(void)
     while (nxtitem(&ni, &land)) {
        if (!player->owner || land.lnd_own == 0)
            continue;
-       if (land.lnd_type < 0 || land.lnd_type > lnd_maxno) {
-           pr("bad unit type %d (#%d)\n", land.lnd_type, ni.cur);
-           continue;
-       }
        if (!(lchr[(int)land.lnd_type].l_flags & L_ENGINEER))
            continue;
        if (land.lnd_mobil <= 0) {